Re: [GENERAL] Converting string to IN query

2008-09-17 Thread Harald Fuchs
In article <[EMAIL PROTECTED]>, "Andrus" <[EMAIL PROTECTED]> writes: > I found that following query works: > create temp table test ( test int ) on commit drop; > insert into test values(1); > select * from test where test = ANY ( '{1,2}' ); > Is this best solution ? > Will it work without causi

Re: [GENERAL] Converting string to IN query

2008-09-16 Thread Andrus
I found that following query works: create temp table test ( test int ) on commit drop; insert into test values(1); select * from test where test = ANY ( '{1,2}' ); Is this best solution ? Will it work without causing stack overflow with 8.2 server default settings if string contains some th

Re: [GENERAL] Converting string to IN query

2008-09-12 Thread Sam Mason
On Fri, Sep 12, 2008 at 04:04:18PM +0100, Richard Huxton wrote: > Andrus wrote: > > String contains list of document numbers (integers) like: > > > > '1,3,4' > > > > How to SELECT documents whose numbers are contained in this string. > > > Numbers should be passed as single string literal since

Re: [GENERAL] Converting string to IN query

2008-09-12 Thread Richard Huxton
Andrus wrote: > String contains list of document numbers (integers) like: > > '1,3,4' > > How to SELECT documents whose numbers are contained in this string. > Numbers should be passed as single string literal since FYIReporting > RDLEngine does not allow multivalue parameters. Hmm - might be w

Re: [GENERAL] Converting string to IN query

2008-09-12 Thread André Volpato
Andrus escreveu: SELECT * FROM invoices WHERE invoiceno IN ( '1,3,4' ); but this causes error. change it to ( '1','3','4' ) or ( 1,3,4 ) -- ACV -- Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/p

[GENERAL] Converting string to IN query

2008-09-12 Thread Andrus
String contains list of document numbers (integers) like: '1,3,4' How to SELECT documents whose numbers are contained in this string. I tried create temp table invoices ( invoiceno int ); insert into invoices values (1); insert into invoices values (2); insert into invoices values (3); insert i