Reputation: 130
I would like to define a stored procedure that receives an array of intergers as an input. Something like this:
CREATE OR REPLACE PROCEDURE "x"(DATE, DATE, INT[] , INT[])
Also, I want to execute it but I do not know how to write it? Maybe like execute x(date1, date2, (1,2,3),(4,5,6)) This pops up an error:
ERROR [42000] ERROR: 'Exec "x"('2011-8-1','2015-9-14',(6,7,1),(1,2,3))'
error ^ found "," (at char 73) expecting IN' or
NOT' or OVERLAPS' or
Op' or `CONCAT_OP'
Upvotes: 1
Views: 674
Reputation: 3887
If you want to pass an array of values in a single parameter position, this will typically have to be done by packing them into a VARCHAR (as it seems you may have already figured out by your later question).
If you need more sophisticated array handling, then you can bring to bear the array functions available in the SQL Extension Toolkit.
Upvotes: 1