Re: Using PL/pgSQL text argument in 'IN (INT,INT,...)' clause - Mailing list pgsql-sql

From Dmitriy Igrishin
Subject Re: Using PL/pgSQL text argument in 'IN (INT,INT,...)' clause
Date
Msg-id AANLkTim9X9FnKegxhm9EdwUfT4SPC_rbmG54d1-reh8R@mail.gmail.com
Whole thread Raw
In response to Using PL/pgSQL text argument in 'IN (INT,INT,...)' clause  (Axel Rau <Axel.Rau@Chaos1.DE>)
Responses Re: Using PL/pgSQL text argument in 'IN (INT,INT,...)' clause
List pgsql-sql
Hey Axel,

How about this solution:
UPDATE foo SET x = y WHERE ANY(string_to_array(blah, ',')) = id;
?

2010/10/25 Axel Rau <Axel.Rau@chaos1.de>
Good morning,

I have a function argument blah of type text containing something like
   33,44,55,66
. Can I cast it in some way to use it in an IN clause as integers like
   UPDATE foo SET x = y WHERE id IN ( blah );
or need I revert to dynamic SQL (EXECUTE...) ?

Thanks, Axel
---
axel.rau@chaos1.de  PGP-Key:29E99DD6  +49 151 2300 9283  computing @ chaos claudius


--
Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-sql



--
// Dmitriy.


pgsql-sql by date:

Previous
From: Dann Corbit
Date:
Subject: Re: [GENERAL] How to update multiple rows
Next
From: Dmitriy Igrishin
Date:
Subject: Re: Using PL/pgSQL text argument in 'IN (INT,INT,...)' clause