SnowConvert AI - Oracle - Data Types¶
This section shows equivalents between data types in Oracle and Snowflake, as well as some notes on arithmetic differences.
Oracle |
Snowflake |
|---|---|
*Go to the link to get more information |
|
VARCHAR |
|
FLOAT |
|
FLOAT |
|
BINARY |
|
CHAR (N) |
|
VARCHAR |
|
TIMESTAMP |
|
FLOAT |
|
VARCHAR(20) |
|
VARCHAR(20) |
|
VARIANT |
|
VARCHAR |
|
BINARY |
|
NCHAR (N) |
|
VARCHAR |
|
NUMBER(p, s) |
|
VARCHAR (N) |
|
BINARY |
|
VARCHAR(18) |
|
VARCHAR (N) |
|
Currently not supported |
|
*to be defined |
|
*to be defined |
|
VARIANT |
|
*to be defined |
|
*to be defined |
|
TIMESTAMP |
|
TIMESTAMP_TZ |
|
TIMESTAMP_LTZ |
|
*to be defined |
|
VARCHAR(18) |
|
VARCHAR |
|
VARCHAR |
|
VARIANT |
Notes on arithmetic operations¶
Please be aware that every operation performed on numerical datatypes is internally stored as a Number. Furthermore, depending on the operation performed it is possible to incur an error related to how intermediate values are stored within Snowflake, for more information please check this post on Snowflake’s post on intermediate numbers in Snowflake.
ANSI Data Types¶
Description¶
SQL statements that create tables and clusters can also use ANSI data types and data types from the IBM products SQL/DS and DB2. Oracle recognizes the ANSI or IBM data type name that differs from the Oracle Database data type name. It converts the data type to the equivalent Oracle data type, records the Oracle data type as the name of the column data type, and stores the column data in the Oracle data type based on the conversions shown in the tables that follow. (Oracle Language Reference ANSI, DB2, and SQL/DS Data Types).
When creating a new table, Oracle and Snowflake handle some data types as synonyms and aliases and transform them into the default data type. As shown in the next table:
ANSI |
ORACLE |
SNOWFLAKE |
|---|---|---|
CHARACTER (n) |
CHAR (n) |
VARCHAR |
CHAR (n) |
CHAR (n) |
VARCHAR |
CHARACTER VARYING (n) |
VARCHAR2 (n) |
VARCHAR |
CHAR VARYING (n) |
VARCHAR2 (n) |
VARCHAR |
NATIONAL CHARACTER (n) |
NCHAR (n) |
VARCHAR* |
NATIONAL CHAR (n) |
NCHAR (n) |
VARCHAR* |
NCHAR (n) |
NCHAR (n) |
VARCHAR |
NATIONAL CHARACTER VARYING (n) |
NVARCHAR2 (n) |
VARCHAR* |
NATIONAL CHAR VARYING (n) |
NVARCHAR2 (n) |
VARCHAR* |
NCHAR VARYING (n) |
NVARCHAR2 (n) |
NUMBER (p, s) |
NUMERIC [(p, s)] |
NUMBER (p, s) |
NUMBER (p, s) |
DECIMAL [(p, s)] |
NUMBER (p, s) |
NUMBER (38) |
INTEGER |
NUMBER (38) |
NUMBER (38) |
INT |
NUMBER (38) |
NUMBER (38) |
SMALLINT |
NUMBER (38) |
NUMBER (38) |
FLOAT |
FLOAT (126) |
DOUBLE |
DOUBLE PRECISION |
FLOAT (126) |
DOUBLE |
REAL |
FLOAT (63) |
DOUBLE |
To get more information about the translation specification of the Oracle data types, go to Oracle Built-in Data Types.
Note
VARCHAR*: Almost all the ANSI datatypes compile in Snowflake, but those marked with an asterisk, are manually converted to VARCHAR.
Known Issues¶
No issues were found.
Data Type Customization¶
SnowConvert AI enables Data Type Customization to specify rules for data type transformation based on data type origin and column name. This feature allows you to personalize data type conversions and set precision values more accurately during migration.
For complete documentation on configuring data type customization, including JSON structure, configuration options, and priority rules, see Data type mappings in the Oracle Conversion Settings documentation.
NUMBER to DECFLOAT Transformation¶
SnowConvert AI supports transforming Oracle NUMBER columns to Snowflake DECFLOAT data type. This is useful when you need to preserve the exact decimal precision of numeric values during migration.
When a NUMBER column is configured to be transformed to DECFLOAT:
The column data type in
CREATE TABLEstatements is transformed toDECFLOATNumeric literals in
INSERTstatements that targetDECFLOATcolumns are automatically wrapped withCAST(... AS DECFLOAT)to ensure proper data type handlingColumn references in
INSERT ... SELECTstatements are also cast appropriately
Example¶
Oracle¶
CREATE TABLE products (
product_id NUMBER(10),
price NUMBER(15, 2)
);
INSERT INTO products VALUES (1, 99.99);
Snowflake (with DECFLOAT customization for price column)¶
CREATE OR REPLACE TABLE products (
product_id NUMBER(10),
price DECFLOAT
);
INSERT INTO products VALUES (1, CAST(99.99 AS DECFLOAT));
Note
The TypeMappings report (TypeMappings.csv) provides a detailed view of all data type transformations applied during conversion. See TypeMappings Report for more information.