|
Re: Passing arrays: msg#00175db.postgresql.novice
On Fri, 14 Feb 2003, Michael Weaver wrote: > > > > -----Original Message----- > > From: Stephan Szabo [mailto:sszabo@xxxxxxxxxxxxxxxxxxxxxxx] > > Sent: Friday, 14 February 2003 12:58 PM > > To: Michael Weaver > > Cc: 'pgsql-novice@xxxxxxxxxxxxxx'; 'pgsql-sql@xxxxxxxxxxxxxx' > > Subject: Re: [SQL] Passing arrays > > > > > > > > On Fri, 14 Feb 2003, Michael Weaver wrote: > > > > > 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... > > > > A straight WHERE field IN (array) doesn't work. That's attempting to > > compare the field directly to the array as a whole (which is > > why you get > > the particular error you do. > > I've got around this limitation using strings, but I do find it suprising, > that Postgres handles arrays this way. > Searching an array in an WHERE IN clause would be a useful task. (namely for > passing arrays of values between stored functions) > > Ok it could be confusing, but I think a number of other DBs employ it to > good effect. > > I'll take a look at the array extension in contrib - it sounds useful. Also check out contrib/intarray and its indexing capabilites if you have 1 dimensional integer arrays. > > Thanks. > ================================================================== Achilleus Mantzios S/W Engineer IT dept Dynacom Tankers Mngmt Nikis 4, Glyfada Athens 16610 Greece tel: +30-10-8981112 fax: +30-10-8981877 email: achill@xxxxxxxxxxxxxxxxxxxxx mantzios@xxxxxxxxxxxxxxxxxxx ---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@xxxxxxxxxxxxxx |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: [SQL] Passing arrays: 00175, Michael Weaver |
|---|---|
| Next by Date: | Re: Cygwin and C triggers: 00175, Alan Clucas |
| Previous by Thread: | Re: [SQL] Passing arraysi: 00175, Michael Weaver |
| Next by Thread: | Re: Passing arrays: 00175, Joe Conway |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | Mail Home | sitemap | FAQ | advertise |