[SQL] Using PL/pgSQL text argument in 'IN (INT,INT,...)' clause

2010-10-29 Thread Axel Rau
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 ---

Re: [SQL] [GENERAL] How to update multiple rows

2010-10-29 Thread Alban Hertroys
On 26 Oct 2010, at 9:07, venkat wrote: Dear All, I want to update multiple row in single query.I am trying for below query.I am getting error as ERROR: more than one row returned by a subquery used as an expression SQL state: 21000 You're probably looking for UPDATE table FROM

Re: [SQL] [GENERAL] How to update multiple rows

2010-10-29 Thread Dann Corbit
If you do not understand what you are doing, it might be a good idea to find someone in your organization who understands SQL. You were given the suggestion UPDATE table SET column list FROM from list ... which is documented here: http://www.postgresql.org/docs/9.0/interactive/sql-update.html

Re: [SQL] Using PL/pgSQL text argument in 'IN (INT,INT,...)' clause

2010-10-29 Thread Dmitriy Igrishin
Hey Axel, How about this solution: UPDATE foo SET x = y WHERE ANY(string_to_array(blah, ',')) = id; ? 2010/10/25 Axel Rau axel@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

Re: [SQL] Using PL/pgSQL text argument in 'IN (INT,INT,...)' clause

2010-10-29 Thread Dmitriy Igrishin
Ooops, sorry UPDATE foo SET x = y WHERE id = ANY(string_to_array(blah, ',')::integer[]); 2010/10/29 Dmitriy Igrishin dmit...@gmail.com Hey Axel, How about this solution: UPDATE foo SET x = y WHERE ANY(string_to_array(blah, ',')) = id; ? 2010/10/25 Axel Rau axel@chaos1.de Good

[SQL] Re: resolved: WITH RECURSIVE: ARRAY[id] All column datatypes must be hashable

2010-10-29 Thread Will Furnass
rawi only4...@web.de writes: The Error was caused because I used UNION in place of UNION ALL. I still don't understand why the ARRAY (path) could not be grouped... Yeah, it's an unimplemented feature --- there's no hashing support for arrays. I hope to get that done for 8.5. In the