TYPE attribute
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
CREATE TABLE table1(
col1 NUMBER
);
CREATE OR REPLACE PROCEDURE procedure1
IS
var1 table1.col1%TYPE;
BEGIN
NULL;
END;Snowflake
TYPE attribute for variables
In this case, the referenced item is a variable declared previously.
Oracle
Snowflake
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)).
These changes don't work for embedded records.
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
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.
Related EWIS
SSC-FDM-0024: Functionality is not currently supported by Snowflake Scripting.
SSC-EWI-OR0129: The statement below has usages of nested cursors.
SSC-FDM-0006: Number type column may not behave similarly in Snowflake.
SSC-EWI-0062: Custom type usage changed to variant.
Last updated