Declarations

This section holds the transformation of declarations that can be made inside procedures or functions.

Some parts in the output code are omitted for clarity reasons.

Variable declaration and assignment

Oracle--Additional Params: -t JavaScript

IN -> Oracle_01.sql
--Additional Params: -t JavaScript

CREATE OR REPLACE PROCEDURE PROC_VARIABLES 
IS
  localVar1 NUMBER;
  localVar2 VARCHAR(100);
  localVar3 VARCHAR2 := 'local variable 3';
  localVar4 VARCHAR2 DEFAULT 'local variable 4';
  localVar5 VARCHAR2 NOT NULL := 'local variable 5';
  localVar6 VARCHAR2 NOT NULL DEFAULT 'local variable 6';
  localVar7 NUMBER := NULL;
  localVar8 NUMBER := '';
BEGIN
    localVar1 := 123;
END;

Snowflake

Record variable declaration

You might also be interested in Records transformation section.

Oracle

Snowflake

Rowtype Record variable declaration

Oracle

Snowflake

Constant Declaration

Oracle

Snowflake

Cursor declarations and definition

Oracle

You might also be interested in Cursor helper

Snowflake

SnowConvert helpers Code removed from the example. You can find them here.

  1. SSC-EWI-0022: One or more identifiers in this statement were considered parameters by default.

  2. SSC-EWI-0026: The variable may requiere a cast to date, time or timestamp.

Last updated