LOG ERROR

Important Notice: Migration of Documentation Website

Please be advised that our documentation website is currently undergoing a migration to a new platform. To ensure you have access to the most up-to-date information, we kindly request that you visit our new documentation website located at:

Official Snowflake Snowconvert Documentation

For any immediate assistance or if you encounter any issues, please contact our support team at [email protected].

Thank you for your understanding.

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

Description

The FORALL statement runs one DML statement multiple times, with different values in the VALUES and WHERE clauses. (Oracle PL/SQL Language Reference FORALL Statement).

FORALL index IN bounds_clause [ SAVE ] [ EXCEPTIONS ] dml_statement ;

Sample Source Patterns

Setup Data

Oracle

IN -> Oracle_01.sql
CREATE TABLE error_table (
    ORA_ERR_NUMBER$ NUMBER,
    ORA_ERR_MESG$ VARCHAR2(2000),
    ORA_ERR_ROWID$ ROWID,
    ORA_ERR_OPTYP$ VARCHAR2(2),
    ORA_ERR_TAG$ VARCHAR2(2000)
);

--departments
CREATE TABLE parent_table(
    Id INT PRIMARY KEY,
    Name VARCHAR2(10)
);

INSERT INTO parent_table VALUES (10, 'IT');
INSERT INTO parent_table VALUES (20, 'HR');
INSERT INTO parent_table VALUES (30, 'INFRA');

--employees
CREATE TABLE source_table(
    Id INT PRIMARY KEY,
    Name VARCHAR2(20) NOT NULL,
    DepartmentID INT REFERENCES parent_table(Id)
);

INSERT INTO source_table VALUES (101, 'Anurag111111111', 10); 
INSERT INTO source_table VALUES (102, 'Pranaya11111111', 20); 
INSERT INTO source_table VALUES (103, 'Hina11111111111', 30);

--a copy of source
CREATE TABLE target_table(
    Id INT PRIMARY KEY,
    Name VARCHAR2(10) NOT NULL,
    DepartmentID INT REFERENCES parent_table(Id)
);

INSERT INTO target_table VALUES (101, 'Anurag', 10);

Snowflake

1. MERGE INTO Inside a FORALL

Oracle

Snowflake

The EWIs MSCCP0005 and SSC-PRF-0003 are added in every FETCH BULK COLLECT occurrence into FORALL statement.

2. FORALL With INSERT INTO

Oracle

Snowflake

3. FORALL With Multiple Fetched Collections

Oracle

Snowflake

4. FORALL With Record of Collections

Oracle

Snowflake

5. FORALL With Dynamic SQL

Oracle

Snowflake

6. FORALL Without LOOPS

Oracle

Snowflake

7. FORALL With UPDATE Statements

Oracle

Snowflake

8. FORALL With DELETE Statements

Oracle

Snowflake

Known Issues

No issues were found.

  1. SSC-EWI-0030: The statement below has usages of dynamic SQL.

  2. SSC-EWI-0036: Data type converted to another data type.

  3. SSC-EWI-0058: Functionality is not currently supported by Snowflake Scripting.

  4. SSC-EWI-0062: Custom type usage changed to variant.

  5. SSC-EWI-OR0129: TYPE attribute could not be resolved.

  6. SSC-FDM-0006: Number type column may not behave similarly in Snowflake.

  7. SSC-FDM-OR0031: The error logging clause in DML statements is not supported by Snowflake.

  8. SSC-PRF-0001: This statement has usages of cursor fetch bulk operations.

  9. SSC-PRF-0003: Fetch inside a loop is considered a complex pattern, this could degrade Snowflake performance.

Last updated