The PLS_INTEGER datatype is transformed to NUMBER. This transformation also applies for each PLS_INTEGER subtype:
NATURAL
NATURALN
POSITIVE
POSITIVEN
SIGNTYPE
SIMPLE_INTEGER
Some of these subtypes are currently not recognized by SnowConvert so they are converted to VARIANT and considered user-defined types. There is already a work item to fix the issue.
Sample Source Patterns
Please, consider the following table and its inserts for the examples below:
CREATETABLEPLS_INTEGER_TABLE( COL NUMBER);
PLS_INTEGER usage in procedural blocks
Oracle
IN -> Oracle_01.sql
CREATEORREPLACEPROCEDURE PLS_INTEGER_EXAMPLEIS-- PLS_INTEGER AND BINARY INTEGER ALIASESPLS_INTEGER_VAR PLS_INTEGER;BINARY_INTEGER_VAR BINARY_INTEGER;NUMBER_VAR NUMBER;BEGIN NUMBER_VAR :=2;-- maximum possible value PLS_INTEGER_VAR :=2147483647;-- implicit cast to numberINSERT INTO PLS_INTEGER_TABLE (COL) VALUES (PLS_INTEGER_VAR); PLS_INTEGER_VAR :=2147483647;-- operations with other numeric expressionsINSERT INTO PLS_INTEGER_TABLE (COL) VALUES (PLS_INTEGER_VAR +1);INSERT INTO PLS_INTEGER_TABLE (COL) VALUES (PLS_INTEGER_VAR + NUMBER_VAR);END;CALL PLS_INTEGER_EXAMPLE();SELECT*FROM PLS_INTEGER_TABLE;
1. Storage and performance features were not preserved
Oracle PLS_INTEGER has some advantages in terms of storage size and performance in arithmetic operations. These features were not emulated because Snowflake NUMBER does not have them. For more information, check the PLS_INTEGER documentation.