WITH, SELECT, and BULK COLLECT INTO statements
This section is a translation specification. Information may change in the future.
Some parts in the output code are omitted for clarity reasons.
Description
This section is a translation specification for the statement WITH subsequent to a SELECT statement which uses a BULK COLLECT INTO statement. For more information review the following documentation:
Sample Source Patterns
Some parts in the output code are omitted for clarity reasons.
The following query is used for the following examples.
1. Inside procedure simple case
This is an approach that uses a resultset data type. User-defined types must be reviewed. Review the following Snowflake documentation to review more information about RESULTSETs.
The following example uses a User-defined type and it is declared indirectly as a table. The translation for this case implements a RESULTSET as a data type in Snowflake. The resultset is stored on a variable which must be returned wrapped on a TABLE()
function.
Oracle
One of the limitations of the RESULTSETs is that they cannot be used as tables. E.g.: select * from my_result_set;
(This is an error, review the following documentation for more information).