SnowConvert AI - IBM DB2 - CREATE SEQUENCE¶
Description¶
The CREATE SEQUENCE statement creates a sequence object that generates successive integer values. SnowConvert AI converts DB2 CREATE SEQUENCE statements to Snowflake equivalents, removing unsupported options and reformatting the statement.
Transformation Rules¶
The following DB2 sequence options are handled during conversion:
DB2 Option |
Snowflake Handling |
|---|---|
|
Removed (Snowflake sequences are always integer-based) |
|
Preserved |
|
Preserved |
|
Removed with SSC-EWI-0120 |
|
Removed with SSC-EWI-0120 |
|
Removed with SSC-EWI-0120 |
|
Removed silently (Snowflake default) |
|
Removed silently |
|
Preserved as |
|
Converted to |
When START WITH is not explicitly specified, the value is inferred from MINVALUE (positive increment) or MAXVALUE (negative increment).
Sample Source Patterns¶
Full Option Removal¶
IBM DB2¶
Snowflake¶
Data Type Removal Only¶
When a sequence has no unsupported options beyond the data type, the AS <type> clause is removed silently.
IBM DB2¶
Snowflake¶
START WITH Inference from MINVALUE¶
When START WITH is missing and INCREMENT BY is positive, the MINVALUE is used as the inferred start value.
IBM DB2¶
Snowflake¶
START WITH Inference from MAXVALUE (Negative Increment)¶
When START WITH is missing and INCREMENT BY is negative, the MAXVALUE is used as the inferred start value.
IBM DB2¶
Snowflake¶
CYCLE Option¶
When CYCLE is specified, it is removed and included in the EWI message.
IBM DB2¶
Snowflake¶
Known Issues¶
SSC-EWI-0120: Sequence options were removed because they are not supported in Snowflake.