I am creating a dynamic query in my function from which I need to extract data. now I want to execute that query.
something like this:
declare
df_id varchar;
BEGIN
/*creating dynamic query in run time and saving it in df_id in string format
say df_id='select col from schema.table_name**'*/
CREATE TEMP TABLE temp_table ON COMMIT DROP AS
execute df_id;
How can I do this? Also, Is there any other way that I can execute the query in string variable and store it to temp table?