TYPE attribute

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

Description

This chapter is related to transforming the TYPE attribute when it references a column, variable, record, collection, or cursor. The transformation involves getting the referenced item data type and replacing the referencing item TYPE attribute for the data type obtained.

Sample Source Patterns

TYPE attribute for columns

In this case, the referenced item is a column from a table created previously.

Oracle

IN -> Oracle_01.sql
CREATE TABLE table1(
col1 NUMBER
);

CREATE OR REPLACE PROCEDURE procedure1
IS
var1 table1.col1%TYPE;
BEGIN
NULL;
END;

Snowflake

Further information about NUMBER datatype can be found in Numeric Data Types section.

TYPE attribute for variables

In this case, the referenced item is a variable declared previously.

Oracle

Snowflake

Further information about FLOAT datatype can be found in FLOAT Data Type section

TYPE attribute for records

In this case, the referenced item is a record declared previously.

Oracle

Snowflake

In the example before, the variable which is referencing the record variable is changed to OBJECT as same as the record variable, and the variable which is referencing the record field is changed to the record field data type (NUMBER (38, 18)).

Further information about records can be found in Collection & Records section.

TYPE attribute for collections

In this case, the referenced item is a collection variable, but since collections are not supported, the referencing item TYPE attribute is changed to VARIANT data type.

Oracle

Snowflake

TYPE attribute for cursors

In this case, the referenced item is a cursor variable, but since REF cursors are not supported, the referencing item TYPE attribute is changed to VARIANT data type.

Oracle

Snowflake

For those cases when the data type of the referenced item cannot be obtained, the referencing item TYPE attribute is changed to VARIANT.

Knows Issues

1. Cursors and collections declarations are not supported.

Collection and cursor variable declarations are not supported yet so the referencing item TYPE attribute is changed to VARIANT and a warning is added in these cases.

2. Original data type could not be obtained.

When the referenced item data type could not be obtained the referencing item TYPE attribute is changed to VARIANT and a warning is added.

  1. SSC-EWI-0036: Data type converted to another data type.

  2. SSC-EWI-0056: Create Type Not Supported.

  3. SSC-EWI-0058: Functionality is not currently supported by Snowflake Scripting.

  4. SSC-EWI-0062: Custom type usage changed to variant.

  5. SSC-EWI-OR0129: The statement below has usages of nested cursors.

  6. SSC-FDM-0006: Number type column may not behave similarly in Snowflake.

Last updated