The synonyms and sequences for the basic introduction to PL/SQL
PL/sql: Process language (Procedure Language) and structured language (structured Query Language)The combination of the programming language, is theSQLextensions that support multiple data types, such as large objects and collection types, can use control statements such as conditions and loops to create stored procedures, packages, triggers, and so on, toSQLthe execution of the statement adds program logic, andOracleservers, andOracletools are tightly integrated, with portability, flexibility, and security.
Synonyms:
/*
synonym: An alias for an existing object;
Advantages:1. Simplify sql;2. The name and owner of the object are hidden ; 3. provides public access to an object
*/
-- creates a private synonym that can only be accessed within the schema and cannot have the same name as the current object
Create or replace synonym em for emp;select *from em;drop synonym em;
-- create public synonyms that can be accessed by all database users, and of course other users have access rights
Create or replace synonym em for emp;select *from em;drop synonym em;
/*
Sequence: An object that is used to generate a unique, sequential ordinal, which can be ascending, or to make descending
*/
Create or replace synonym em for emp;select *from em;drop synonym em;
-- Query Sequence
Select My_seq.nextval from dual;--sequence next value Select My_seq.currval from dual;--sequence current value CREATE TABLE person ( PID number Prima Ry Key, pname varchar2 (20))
Article Source: http://blog.csdn.net/ysjian_pingcx/article/details/25646607