alt
Advertisement
Sponsored links
Online Training
Career Series
Exforsys
Exforsys arrow Tutorials arrow Oracle 10g arrow Oracle 10g Free Training - Synonyms
Site Search


Oracle 10g Free Training - Synonyms
Article Index
Oracle 10g Free Training - Synonyms
Page 2

.

.

INSERT INTO Emp_tab (Empno, Ename, Job)
VALUES (Emp_sequence.NEXTVAL, 'SMITH', 'CLERK');

 

 

 

 

 

The image cannot be displayed, because it contains errors.

Figure 30. Inserting in a table using a synonym (Emp_tab).

If the synonym named fire_emp refers to a standalone procedure or package procedure, then you could execute it with the command

EXECUTE Fire_emp(7344);

Dropping Synonyms

You can drop any private synonym in your own schema. To drop a private synonym in another user's schema, you must have the DROP ANY SYNONYM system privilege. To drop a public synonym, you must have the DROP PUBLIC SYNONYM system privilege.

Drop a synonym that is no longer required using DROP SYNONYM statement. To drop a private synonym, omit the PUBLIC keyword. To drop a public synonym, include the PUBLIC keyword.

For example, the following statement drops the private synonym named emp:

DROP SYNONYM emp;

The image cannot be displayed, because it contains errors.

Figure 31. Dropping a synonym.

The following statement drops the public synonym named public_emp:

DROP PUBLIC SYNONYM public_emp;

The image cannot be displayed, because it contains errors.

Figure 32. Dropping a public synonym.

When you drop a synonym, its definition is removed from the data dictionary. All objects that reference a dropped synonym remain. However, they become invalid (not usable).

Viewing Information About Views, Synonyms, and Sequences

The following views display information about views, synonyms, and sequences:

View
Description
DBA_VIEWS
ALL_VIEWS
USER_VIEWS
DBA view describes all views in the database. ALL view is restricted to views accessible to the current user. USER view is restricted to views owned by the current user.
DBA_SYNONYMS
ALL_SYNONYMS
USER_SYNONYMS
These views describe synonyms.
DBA_SEQUENCES
ALL_SEQUENCES
USER_SEQUENCES
These views describe sequences.
DBA_UPDATABLE_COLUMNS
ALL_UPDATABLE_COLUMNS
USER_UPDATABLE_COLUMNS
These views describe all columns in join views that are updatable.


Trackback(0)
Comments (0)add comment

Write comment

busy

 
< Prev   Next >
Exforsys Offers
© 2008 Exforsys.com
Joomla! is Free Software released under the GNU/GPL License.
Page copy protected against web site content infringement by Copyscape