imploding/using arrays for IN (...)

From: Cool Screen <cool_screen_name90001(at)yahoo(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: imploding/using arrays for IN (...)
Date: 2002-10-17 19:11:55
Message-ID: 20021017191155.86278.qmail@web40609.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Passing an array to a PL/pgSQL function, is it
possible to implode it and use with IN (...) ? For
example:

my_func(int[])
ids := implode_func($1);

select *
from x
where id in (ids);

I tried concatenating ids together with ',', but the
query gives an integer/text cast error. Or, is it
possible use arrays in IN()?

select *
from x
where id in ({1,2,3});

__________________________________________________
Do you Yahoo!?
Faith Hill - Exclusive Performances, Videos & More
http://faith.yahoo.com

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mark Wilson 2002-10-17 20:46:41 Re: imploding/using arrays for IN (...)
Previous Message Cool Screen 2002-10-17 19:08:32 imploding/using arrays for IN (...)