Migration of DB2 database Sequence

Source: Internet
Author: User

Migration of DB2 database sequence 1. generate the following statement to obtain the current value of the source database sequence: www.2cto.com SQL code SELECT 'select' CREATE SEQUENCE '| seqname | 'start WITH ''' |' | seqname | '. nextval from sysibm. sysdummy1' FROM syscat. sequences WHERE seqtype ='s AND seqschema = CURRENT schema www.2cto.com 2. execute the SQL statement that generates the SEQUENCE of the target database one by one based on the statements generated in the first step. For example, the SQL code SELECT 'create SEQUENCE SEQ_CCP_CM_CLIENT_INFO START with' | SEQ_CCP_CM_CLIENT_INFO.nextval Sibm. sysdummy1 SELECT 'create SEQUENCE SEQ_CCP_MM_BRODCAST_INFO START with' | SEQ_CCP_MM_BRODCAST_INFO.nextval from sysibm. sysdummy1 SELECT 'create SEQUENCE SEQ_CCP_MM_INDUSTRY_INFO START with' | SEQ_CCP_MM_INDUSTRY_INFO.nextval from sysibm. sysdummy1 SELECT 'create SEQUENCE SEQ_CCP_MM_WARN_LEVEL START with' | SEQ_CCP_MM_WARN_LEVEL.nextval from sysibm. sysdummy1 SELECT 'create SEQUENCE SEQ_CCP _ RM_BACK_PLAN start with '| SEQ_CCP_RM_BACK_PLAN.nextval from sysibm. sysdummy1 SELECT 'create SEQUENCE SEQ_CCP_RM_CERT_INFO START with' | SEQ_CCP_RM_CERT_INFO.nextval from sysibm. sysdummy1 SELECT 'create SEQUENCE SEQ_CCP_RM_CLNT_RELATION START with' | SEQ_CCP_RM_CLNT_RELATION.nextval from sysibm. sysdummy1 3. execute the statement generated in step 2. It should be a bit more automated, and there is no time to test now!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.