|
Passing arrays: msg#00171db.postgresql.novice
How do you get an array of elements to be passed to a stored proc such that you can use the array in a SELECT statement in the WHERE clause - e.g. WHERE field IN (array) etc... CREATE OR REPLACE FUNCTION sp_report_retail_sales(int8[]) RETURNS SETOF sp_report_retail_sales_type AS '
FOR retset IN
FROM tbl_prdcrd INNER JOIN tbl_tranitem ON tbl_prdcrd.fld_prdcrd_id = tbl_tranitem.fld_tranitem_productid INNER JOIN tbl_tran ON tbl_tranitem.fld_tranitem_transactionid = tbl_tran.fld_tran_id
We were calling the procedure as follows
We keep getting issues with casting. <snip> WARNING: Error occurred while executing PL/pgSQL function sp_report_retail_sale
</snip> Trying the parameter as text worked, but gave 0 rows in result set. , Mike Weaver
5, 42 Ladner Street
P: (+618) 9331 2700
This email is intended only for the use of the individual or entity named above and may contain information that is confidential. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this email is strictly prohibited. When addressed to our clients, any opinions or advice contained in this email are subject to the terms and conditions expressed in the governing Corpus Globe client engagement letter. If you have received this Email in error, please notify us immediately by return email or telephone +61 8 9331 2700 and destroy the original message. Thank You. |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: Executing SQL commands in script files: 00171, Josh Berkus |
|---|---|
| Next by Date: | Re: Passing arrays: 00171, Josh Berkus |
| Previous by Thread: | Returning result sets.i: 00171, Michael Weaver |
| Next by Thread: | Re: Passing arrays: 00171, Josh Berkus |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |