SSC-EWI-OR0068

The sequence start value exceeds the max value allowed by Snowflake.

Severity

Medium

Description

This error appears when the START WITH statement value exceeds the maximum value allowed by Snowflake. What Snowflake said about the start value is: Specifies the first value returned by the sequence. Supported values are any value that can be represented by a 64-bit two’s complement integer (from -2^63 to 2^63-1). So according to the previously mentioned, the max value allowed is 9223372036854775807 for positive numbers and 9223372036854775808 for negative numbers.

Example Code

Input Code:

IN -> Oracle_01.sql
CREATE SEQUENCE SEQUENCE1
START WITH 9223372036854775808;
IN -> Oracle_02.sql
CREATE SEQUENCE SEQUENCE2
START WITH -9223372036854775809;

Output Code:

OUT -> Oracle_01.sql
CREATE OR REPLACE SEQUENCE SEQUENCE1
!!!RESOLVE EWI!!! /*** SSC-EWI-OR0068 - SEQUENCE START VALUE EXCEEDS THE MAX VALUE ALLOWED BY SNOWFLAKE. ***/!!!
START WITH 9223372036854775808
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}';
OUT -> Oracle_02.sql
CREATE OR REPLACE SEQUENCE SEQUENCE2
!!!RESOLVE EWI!!! /*** SSC-EWI-OR0068 - SEQUENCE START VALUE EXCEEDS THE MAX VALUE ALLOWED BY SNOWFLAKE. ***/!!!
START WITH -9223372036854775809
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}';

Recommendations

  • It can be recommended to just reset the sequence and modify its usage too. NOTE: the target column must have enough space to hold this value.

  • If you need more support, you can email us at snowconvert-support@snowflake.com

Last updated