DEFAULT PARAMETERS
This article is about the current transformation of the default parameters and how their functionality is being emulated.
Description
A default parameter is a parameter that has a value in case an argument is not passed in the procedure or function call. Since Snowflake doesn't support default parameters, SnowConvert inserts the default value in the procedure or function call.
In the declaration, the DEFAULT VALUE clause of the parameter is removed. Both syntaxes, the := symbol and the DEFAULT clause, are supported.
Sample Source Patterns
Sample auxiliary code
CREATE TABLE TABLE1(COL1 NUMBER, COL2 NUMBER);
CREATE TABLE TABLE2(COL1 NUMBER, COL2 NUMBER, COL2 NUMBER);0016CREATE OR REPLACE TABLE TABLE1 (COL1 NUMBER(38, 18) /*** SSC-FDM-0006 - NUMBER TYPE COLUMN MAY NOT BEHAVE SIMILARLY IN SNOWFLAKE. ***/,
COL2 NUMBER(38, 18) /*** SSC-FDM-0006 - NUMBER TYPE COLUMN MAY NOT BEHAVE SIMILARLY IN SNOWFLAKE. ***/
)
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
;
CREATE OR REPLACE TABLE TABLE2 (COL1 NUMBER(38, 18) /*** SSC-FDM-0006 - NUMBER TYPE COLUMN MAY NOT BEHAVE SIMILARLY IN SNOWFLAKE. ***/,
COL2 NUMBER(38, 18) /*** SSC-FDM-0006 - NUMBER TYPE COLUMN MAY NOT BEHAVE SIMILARLY IN SNOWFLAKE. ***/,
COL2 NUMBER(38, 18) /*** SSC-FDM-0006 - NUMBER TYPE COLUMN MAY NOT BEHAVE SIMILARLY IN SNOWFLAKE. ***/
)
COMMENT = '{"origin":"sf_sc","name":"snowconvert","version":{"major":1, "minor":0},{"attributes":{"component":"oracle"}}'
;Default parameter declaration
Oracle
Snowflake Scripting
Calling procedures with default parameters
Oracle
Snowflake Scripting
In order to check that the functionality is being emulated correctly the following query is going to execute the procedure and a SELECT from the table mentioned before.
Oracle
Snowflake Scripting
Calling procedures with named arguments and default parameters
Oracle
Snowflake Scripting
In order to check that the functionality is being emulated correctly the following query is going to execute the procedure and a SELECT from the table mentioned before.
Oracle
Snowflake Scripting
Known Issues
1. No issues found
Related EWIs
No related EWIs.
Last updated
