Procedures

Snowflake CREATE PROCEDURE is defined in SQL Syntax whereas its inner statements are defined in JavaScript.

Example 1: Basic Procedure Conversion

Oracle

CREATE OR REPLACE PROCEDURE PROC1
IS
BEGIN
null;
END;

Snowflake

circle-info

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

CREATE OR REPLACE PROCEDURE PROC1 ()
RETURNS STRING
LANGUAGE JAVASCRIPT
EXECUTE AS CALLER
AS
$$
    null;
$$

Example 2: Procedure Conversion with basic statements: Declaration, Assignment, Cursor Declaration, FOR Cursor, Open, LOOP, CLOSE, IF,

Oracle

Snowflake

circle-info

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

Call of procedures inside other procedure

Oracle

Snowflake

circle-info

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

Last updated

Was this helpful?