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;
4、IXCOM必须序列
--IXCOM创建必须序列 USER_SEQ--
CREATE SEQUENCE USER_SEQ
START WITH 1
INCREMENT BY 1
MINVALUE 1
MAXVALUE 2147483647
CYCLE
CACHE 20
NO ORDER;
--IXCOM创建必须序列 SEQ_SENT_MESSAGE--
CREATE SEQUENCE SEQ_SENT_MESSAGE
START WITH 1
INCREMENT BY 1
MINVALUE 1
MAXVALUE 2147483647
NOCYCLE
CACHE 20
NO ORDER;
--IXCOM创建必须序列 SEQ_RECEIVED_MESSAGE--
CREATE SEQUENCE SEQ_RECEIVED_MESSAGE
START WITH 1
INCREMENT BY 1
MINVALUE 1
MAXVALUE 2147483647
NOCYCLE
CACHE 20
NO ORDER;