zoukankan      html  css  js  c++  java
  • ORCALE SYNONYM && SEQUENCE

    一、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.

  • 相关阅读:
    Log4j2 配置
    Spring + SpringMVC配置
    Tomcat 动态数据库连接池
    MySQL数据库备份命令
    一条insert语句插入数据库
    tomcat 性能优化
    linux RPM manager
    mysql 多主
    ceph学习
    python常用程序算法
  • 原文地址:https://www.cnblogs.com/s021368/p/1440800.html
Copyright © 2011-2022 走看看