Skip to content
Advertisement

how to pass in array in procedure call in oracle

I have a procedure that takes in an array in postgres, this syntax works:

SELECT * from myMethod(array['test','test'], array[''], 554, 73430, 322234, 'shazam');

the array keyword is what I am referring to. this works in postgres but I cannot find the documentation to understand how this work in oracle. how do i pass in arrays to function call?

the error when running the above is:

Advertisement

Answer

If you have the type:

and create your function:

Then you can do:

In earlier Oracle versions, you may need to use:

and it outputs:

| COLUMN_VALUE    |
| :-------------- |
| shazamtest1abcd |
| shazamtest2abcd |

db<>fiddle here

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