Skip to content
Advertisement

How to separate a value taken from a table row and store it in an array in a snowflake

I need to return an array in the stored procedure that takes a comma separated string value from a table and divides that string based on the comma and stores them in an array.

Example: My table has a Column Tab_Val with row value as "COL1,COL2,COL3,COL4", I need to take this row in my stored procedure and return an array as arr =['COL1','COL2','COL3','COL4']

Here is my attempt:

Advertisement

Answer

Try this

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement