天下無雙
阿龍 --质量是流程决定的。

一、SYNONYM

1.CREATE

   CREATE SYNONYM dept FOR SCOTT.dept;

2.DROP

   DROP SYNONYM dept;

3.CREATE PUBLIC SYNONYM

   CREATE PUBLIC SYNONYM dept FOR SCOTT.dept

4.DISPLAY SYNONYM

  DESC DBA_SYNONYMS;

  DESC USER_SYNONYMS;

 

二、SEQUENCE

1.CREATE

  CREATE SEQUENCE myseq
  START WITH 1  --start from the value
  INCREMENT BY 1 --increace 1 one time
  ORDER             
  NOCYCLE            
  /

2.DISPLAY

  SELECT  myseq.NEXTVAL FROM dual;

  SELECT myseq.CURRVAL FROM dual;

3.DISPLAY SEQUENCES

   DESC DBA_SEQUENCES;

   DESC USER_SEQUENCES;

 NOTE:First, should use NEXTVAL, and then the CURRVAL has value.

          When the DB Server stopped, though the myseq has value, but you should first use NEXTVAL too, and then you could select the CURRVAL.

 

 

posted on 2009-04-21 21:41  阿龍  阅读(228)  评论(0编辑  收藏  举报