1、查询db2数据库序列
--查询db2数据库序列--
SELECT
*
FROM
"SYSIBM".SYSSEQUENCES s
WHERE
1 = 1
AND SEQSCHEMA = 'IXCOM'
AND SEQNAME = 'SEQ_SENT_MESSAGE'
ORDER BY
CREATE_TIME DESC
2、创建序列
CREATE SEQUENCE <sequence_name>
AS <data_type>
START WITH <starting_value>
INCREMENT BY <increment_value>
[MINVALUE <minimum_value>]
[MAXVALUE <maximum_value>]
[CYCLE | NO CYCLE]
[CACHE <cache_size> | NO CACHE]
[ORDER | NO ORDER];
3、举例创建序列
CREATE SEQUENCE SEQ_TESTNAME
START WITH 1
INCREMENT BY 1
MINVALUE 1
MAXVALUE 99999999999
CYCLE
CACHE 20
NO ORDER;