I am creating a dynamic query to extract some data from a table. I want to store that data in a variable but it cannot store more that one value. And I can also use temp table but in some cases I am not allowed to use that also. Now I was trying to store data in array form:
Example:
say df_id='select col from schema.table_name'
is the dynamic query created during run time.
declare
var_tmp varchar [];
BEGIN
execute 'select array_agg(col)
into var_tmp from ('||df_id||') as y';
but I am getting
error: no schema has been selected.
How Can I perform this? Also, Is there any other alternative to store multiple data in a function?