Databases Reference
In-Depth Information
increment by 10;
Sequence created.
After the sequence has been created, the user HR inserts a record into the
EMPLOYEES table as follows:
insert into employees
(employee_id, last_name, first_name, email,
hire_date, job_id)
values
(employees_seq.nextval, 'JUDD', 'DAWN', 'DRJUDD',
'25-may-04','QA_MAN');
1 row created.
select employee_id from employees
where last_name = 'JUDD';
EMPLOYEE_ID
-----------
501
1 row selected.
The next time the employees_seq sequence is used, the value returned will
be 511.
Synonyms
A synonym is an alias for another database object, such as a table, sequence, or view.
Synonyms provide easier access to database objects outside the user's schema.
There are two kinds of synonyms: public and private. Public synonyms are
available to all database users. A private synonym is available only in the session
of the schema owner who created it.
Synonyms are useful in providing a common name to a database object, regard-
less of which username is logged in to the database. The temporary table created by
Janice the DBA, called TRAVEL_DEST, must be qualified with the schema name if
anyone other than Janice wants to access it. For example, if the user HR is connected
to the database and no synonym has been specified, the table must be fully qualified:
synonym
An alias assigned to a table, view, or
other database structure. Synonyms
can be either available to all users
(public) or available only to one schema
owner (private).
insert into janice.travel_dest
values(101, 1201, 320.50, 988.00);
Search WWH ::




Custom Search