Synonyms and sequences of Oracle Practice--pl/sql Foundation

Source: Internet
Author: User

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


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.