WITH, SELECT, and BULK COLLECT INTO statements
Last updated
Last updated
This section is a translation specification. Information may change in the future.
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:
.
.
The following query is used for the following examples.
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.
The following case is to define a translation for iteration with FOR...LOOP
. In this case, the User-defined type is implicitly a table, thus, it is possible to use a cursor to iterate. Review the following documentation to learn more:
Declaring a column of type RESULTSET.
Declaring a parameter of type RESULTSET.
Declaring a stored procedure’s return type as a RESULTSET.
This is an approach that uses a resultset data type. User-defined types must be reviewed. Review the following to review more information about RESULTSETs.
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 for more information).
Snowflake documentation about Returning a
In this case, there is a need to create a cursor for the iteration. Review the following documentation.
There are limitations while using the RESULTSET data type. Review the following to learn more. Markable limitations are the following:
Review the following .
: Functionality is not currently supported by Snowflake Scripting.
: Custom type usage changed to variant.
: Pending Functional Equivalence Review
: Types resolution issues, the arithmetic operation may not behave correctly between string and date.
: Procedural Member not supported
: Unusable collection variable.
: Number type column may not behave similarly in Snowflake.
: DBMS_OUTPUT.PUTLINE check UDF implementation.