SnowConvert AI - Oracle - HELPERS¶
In this section you will find helper functions or procedures that are used to achieve functional equivalence of some Oracle features that are not supported natively in Snowflake Scripting.
Bulk Cursor Helpers¶
Note
You might also be interested in Default FORALL transformation.
The Cursor is simulated with an OBJECT with different information regarding the state of the cursor. A temporary table is created to store the result set of the cursor’s query.
Most of these Procedures return a new Object with the updated state of the cursor.
INIT_CURSOR¶
This function initializes a new object with the basic cursor information
OPEN_BULK_CURSOR¶
These procedures create a temporary table with the query of the cursor. An optional overload exists to support bindings.
CLOSE_BULK_CURSOR¶
This procedure deletes the temporary table that stored the result set of the cursor and resets the cursor’s properties to their initial state.
FETCH Helpers¶
Due to Oracle being capable of doing the FETCH statement on different kind of scenarios, multiple procedures with overloads were created to handle each case. These helpers save the fetched values into the RESULT property in the CURSOR object.
Some of the overloads include variations when the LIMIT clause was used or not. Other overloads have a COLUMN_NAMES argument that is necessary when the FETCH statement is being done into a variable that has or contains records with column names that are different to the column names of the query.
FETCH_BULK_COLLECTION_RECORDS¶
These procedures are used when a FETCH BULK is done into a collection of records.
FETCH_BULK_COLLECTIONS¶
These procedures are used when the FETCH statement is done into one or multiple collections. Since the columns are specified in this FETCH operation, an override for specific COLUMN_NAMES is not necessary.
FETCH_BULK_RECORD_COLLECTIONS¶
These procedures are used when a FETCH BULK is done into a record of collections.