I am trying to get 4 column names from the table which has 10 rows and I want to loop through all rows in that table and pass those column values as parameters into some other stored procedure.
How can I store the result set of the below query and use them to pass in a for loop ? CREATE OR REPLACE PROCEDURE SP_MAIN() RETURNS VARCHAR(16777216) LANGUAGE JAVASCRIPT EXECUTE AS CALLER AS '
var DETS = select * from SNAPSHOT.SNAPSHOT_CONFIG ;
snowflake.execute({sqlText: DETS});
'
;
I was able to acheive this as below: