db2 sequence 查询

  1.

查询名字

select * from sysibm.sysequences where seqname='wx_Id'

 

2.nextVal

select wx_seq_id.currval from sysibm.sysdummy1

select wx_seq_id.prevval from sysibm.sysdummy1

select wx_seq_id.nextval from sysibm.sysdummy1

 

3.

select nextval for wx_seq_id from sysibm.sysdummy1

查prev和curr时必须先执行nextval不然报错

posted on 2017-03-22 17:44  蒂其之死  阅读(8716)  评论(0编辑  收藏  举报

导航