SnowConvert AI - IBM DB2 - CREATE TYPE¶
This page describes how SnowConvert translates Db2 distinct types (CREATE DISTINCT TYPE ... AS type), structured CREATE TYPE ... AS (...) definitions, and array types (CREATE [DISTINCT] TYPE ... AS <type> ARRAY[n]). Distinct types map to Snowflake CREATE TYPE name AS <base_type>; attribute lists map to OBJECT(...); array types map to ARRAY ( <type> ), dropping the fixed cardinality and emitting SSC-FDM-0043.
Distinct types¶
CREATE DISTINCT TYPE becomes CREATE TYPE. The WITH COMPARISONS clause is not carried forward; base types use the same data-type normalization as the rest of the Db2 migration.
Source (Db2):
Snowflake equivalent:
Source (Db2):
Snowflake equivalent:
Source (Db2):
Snowflake equivalent:
Structured types (attribute list)¶
Composite-style definitions with CREATE TYPE name AS (col type, ...) map to Snowflake OBJECT(...).
Source (Db2):
Snowflake equivalent:
Source (Db2):
Snowflake equivalent:
Array types¶
Db2 array type definitions of the form <element_type> ARRAY[<size>] map to Snowflake ARRAY ( <element_type> ). Snowflake ARRAY is a single, dynamically-sized type, so the fixed cardinality from the source is dropped and SSC-FDM-0043 is emitted to flag the behavioral difference. The same translation applies whether the type is defined with CREATE TYPE or CREATE DISTINCT TYPE, and whether or not a schema qualifier is present. Unbounded ARRAY[] is also recognized; in that case no FDM is needed because there is no size limit to drop.
Source (Db2):
Snowflake equivalent:
Source (Db2):
Snowflake equivalent:
Source (Db2):
Snowflake equivalent:
Source (Db2):
Snowflake equivalent:
Note: CREATE DISTINCT TYPE is normalized to CREATE TYPE in the Snowflake output (the DISTINCT keyword has no equivalent in Snowflake’s type system).
Notes: If application logic depends on a maximum array length, enforce it outside the type definition (for example with check constraints or in application code). Snowflake will not raise an error on values that exceed the original cardinality. See IBM’s reference for CREATE TYPE (array).