Constants
Translation spec for Package Constants
Description
PACKAGE CONSTANTS can be declared either in the package declaration or in the PACKAGE BODY. When a package constant is used in a procedure, a new variable is declared with the same name and value as the constant, so the resulting code is pretty similar to the input.
constant CONSTANT datatype [NOT NULL] { := | DEFAULT } expression ;Sample Source Patterns
Sample auxiliary code
create table table1(id number);CREATE OR REPLACE TABLE PUBLIC.table1 (
id NUMBER(38, 18) /*** MSC-WARNING - MSCEWI1066 - NUMBER TYPE COLUMN MAY NOT BEHAVE SIMILARLY IN SNOWFLAKE ***/
);Oracle
CREATE OR REPLACE PACKAGE PKG1 AS
PROCEDURE procedure1;
package_constant CONSTANT NUMBER:= 9999;
END PKG1;
CREATE OR REPLACE PACKAGE BODY PKG1 AS
PROCEDURE procedure1 AS
BEGIN
INSERT INTO TABLE1(ID) VALUES(package_constant);
END;
END PKG1;
CALL PKG1.procedure1();
SELECT * FROM TABLE1;|ID |
|----|
|9999|
Snowflake
Known Issues
No issues were found.
Related EWIs
No related EWIs.
Last updated
Was this helpful?