| From: | Richard Huxton <dev(at)archonet(dot)com> |
|---|---|
| To: | Marcin Winkler <qurczak(at)wolomin(dot)biz>, pgsql-sql(at)postgresql(dot)org |
| Subject: | Re: is this possible in plpgsql ? |
| Date: | 2003-06-19 18:23:24 |
| Message-ID: | 200306191923.24885.dev@archonet.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-sql |
On Thursday 19 Jun 2003 1:38 am, Marcin Winkler wrote:
> I have 1 function in pg 7.3.2.
>
> txt string have 1,2,3,.. and i would like to be similar like if 3 in
> (1,2,3..) then, but IF 3 in (''''||txt||'''') THEN doesn't work.
> There is possible to this or not ?
> txt := '''';
> for i in 1 .. 10 loop
> txt := txt||i||'','';
> END loop;
> txt := txt||''0'';
> IF 3 in (''''||txt||'''') THEN
> raise notice ''yep'';
Try something like:
query:=''SELECT 3 in ('' || txt || '')''
EXECUTE query;
Then check the result for true/false
--
Richard Huxton
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Paul Thomas | 2003-06-19 18:38:46 | Re: [JDBC] maxconnection |
| Previous Message | murali | 2003-06-19 17:50:53 | Postgres - Delphi Application |