Skip Top Menu Navigation
Skip Top Menu Navigation

The FREE Enterprise Open Source Database

  Software Documentation Tools Interfaces Administration Development
 

 
You Are Here:
SAP DB > Documentation > How To > Number Generator > CREATE SEQUENCE statement > Sequence for Several Tables

SAP DB is now SAP MaxDB! For more information, visit the SAP MaxDB pages in the SAP Developer Network.

Sequence for Several Tables (Example)

Use

If you want to use unique number values across several tables, enter <sequence_name>.NEXTVAL.

Syntax

CREATE SEQUENCE myseq

INSERT mytab1 VALUES (myseq.NEXTVAL ... values for the remaining columns)

INSERT mytab2 VALUES (some column values..., myseq.NEXTVAL, ... further column values)



Search / Contact Info

Questions or comments about the Web site? Contact the webmaster.