加入收藏 | 设为首页 | 会员中心 | 我要投稿 PHP编程网 - 黄冈站长网 (http://www.0713zz.com/)- 数据应用、建站、人体识别、智能机器人、语音技术!
当前位置: 首页 > 百科 > 正文

Oracle Sequences

发布时间:2020-12-31 07:15:57 所属栏目:百科 来源:网络整理
导读:Sequence: Define a Sequence to generate sequential numbers automatically ? example:可以在 update、select、insert语句中使用 SQL edWrote file afiedt.buf 1 create sequence test_seq 2 increment by 10 3 start with 100 4 maxvalue 200 5 minvalu

Sequence: Define a Sequence to generate sequential numbers automatically

?

  example:可以在 update、select、insert语句中使用

  

SQL> ed
Wrote file afiedt.buf

  1  create sequence test_seq
  2  increment by 10
  3  start with 100
  4  maxvalue 200
  5  minvalue 110
  6  cycle
  7* nocache
SQL> /
create sequence test_seq
*
ERROR at line 1:
ORA-04006: START WITH cannot be less than MINVALUE

SQL> ed
Wrote file afiedt.buf
  1  create sequence test_seq
  2  increment by 10
  3  start with 120
  4  maxvalue 200
  5  minvalue 110
  6  cycle
  7* nocache
SQL> /
Sequence created.
SQL> select test_seq.nextval from dual;
   NEXTVAL
----------
       120

SQL> select test_seq.currval from dual

   CURRVAL
----------
       120

SQL> 

(编辑:PHP编程网 - 黄冈站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    热点阅读