Work around to simulate the use of Records

Description

This section describes how to simulate the behavior of Oracle records in SELECT and INSERT Statements, using RESULTSET and CURSORS of Snowflake Scripting.

Snowflake Scripting RESULTSET and CURSOR

You might also be interested in CURSOR.

<resultset_name> RESULTSET [ DEFAULT ( <query> ) ] ;

LET <resultset_name> RESULTSET [ { DEFAULT | := } ( <query> ) ] ;

LET <resultset_name> RESULTSET [ { DEFAULT | := } ( <query> ) ] ;

Recommendations

For the following examples, this code was executed to better understanding of the examples:

CREATE TABLE numbers_table(num integer, word varchar2(20));
INSERT INTO numbers_table VALUES (1, 'one');
CREATE TABLE aux_numbers_table(aux_num integer, aux_word varchar2(20));

Using RESULTSET and Cursors instead of Records

Oracle

Snowflake

Known Issues

1. Limitation in the use of RESULTSET

RESULTSET is very limited in its use. If table(result_scan(last_query_id())) statement, should be used just after the RESULTSET's query is executed. For further information check this link.

No related EWIs.

Last updated

Was this helpful?