Search Postgresql Archives

Converting string to IN query

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 into invoices values (4);
SELECT * FROM invoices WHERE invoiceno IN ( '1,3,4' );

but this causes error.

Numbers should be passed as single string literal since FYIReporting RDLEngine does not allow multivalue parameters.

How to fix this so that query returns invoices whose numbers are contained in string literal ?
Can arrays used to convert string to list or any other solution ?

Andrus.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux