Collection Bulk Operations
This is a translation reference to convert the Oracle Collection Bulk Operations to Snowflake
This section is a work in progress, information may change in the future
Some parts in the output code are omitted for clarity reasons.
Description
The
BULK
COLLECT
clause, a feature of bulk SQL, returns results from SQL to PL/SQL in batches rather than one at a time.The
BULK
COLLECT
clause can appear in:
SELECT
INTO
statement
FETCH
statement
RETURNING
INTO
clause of:
DELETE
statement
INSERT
statement
UPDATE
statement
EXECUTE
IMMEDIATE
statementWith the
BULK
COLLECT
clause, each of the preceding statements retrieves an entire result set and stores it in one or more collection variables in a single operation (which is more efficient than using a loop statement to retrieve one result row at a time).
(Oracle PL/SQL Language Reference BULK COLLECT CLAUSE)
This section has some workarounds for SELECTs and FETCH Cursor with Bulk Clauses.
Sample Source Patterns
Source Table
Oracle
Snowflake
Bulk Collect from a Table
Oracle
Snowflake
EXECUTE IMMEDIATE with Bulk Collect clause has no workarounds offered.
Please note, that while the FETCH Cursor can be mostly preserved, it is advised to be changed into SELECT statements whenever possible for performance issues.
SELECT INTO statement case
In this case, the translation specification uses RESULTSETs. Review the documentation for WITH, SELECT, and BULK COLLECT INTO statements here:
WITH, SELECT, and BULK COLLECT INTO statementsKnown Issues
1. Heavy performance issues on FETCH Cursor workaround
The workaround for the Fetch cursor has heavy performance requirements due to the Temporary table. It is advised for them to be manually migrated to SELECT statements
2. Execute immediate statements are not transformed
They are not supported by SnowConvert but may be manually changed to SELECT statements.
Related EWIs
SSC-EWI-0058: Functionality is not currently supported by Snowflake Scripting.
SSC-EWI-0062: Custom type usage changed to variant.
SSC-EWI-0073: Pending Functional Equivalence Review
SSC-EWI-OR0036: Types resolution issues, the arithmetic operation may not behave correctly between string and date.
SSC-EWI-OR0108: The Following Assignment Statement is Not Supported by Snowflake Scripting.
SSC-FDM-OR0035: DBMS_OUTPUT.PUTLINE check UDF implementation.
SSC-PRF-0001: This statement has usages of cursor fetch bulk operations.
SSC-EWI-0030: The statement below has usages of dynamic SQL
Last updated