Last active
March 16, 2023 23:52
-
-
Save cnukaus/0bdda47d74e1487636c8fb90976b0527 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
create or preplace procedure `proc_name` | |
BEGIN | |
declare k_array ARRAY<struct><banner string, intiative_type string>; | |
set k_array = | |
( | |
select array_agg(meta) from | |
(SELECT struct(banner,initiative_type) as meta | |
from storing_table | |
) t | |
); | |
for element in ( | |
select * from unnest(k_array)) DO | |
EXECUTE IMMEDIATE format( | |
""" SELECT '%s' # this is arg1 | |
""", | |
element.banner.element.initiative_type | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment