Den 2011-05-03 08:06 skrev Maxim Kuzmin (JIRA) såhär:
> IN with string, contained multiple values
> -----------------------------------------
>
>                   Key: CORE-3460
>                   URL: http://tracker.firebirdsql.org/browse/CORE-3460
>               Project: Firebird Core
>            Issue Type: Improvement
>              Reporter: Maxim Kuzmin
>              Priority: Trivial
>
>
> When using WHERE with IN (), for condition allowed only single value (integer 
> or varchar). When using string-condition with multiple values, it's raise 
> exception:
> SELECT FROM TABLE 1 WHERE ID IN ('1') -- OK
> SELECT FROM TABLE 1 WHERE ID IN ('1, 2, 4, 6') -- EXCEPTION

Correct syntax is:
SELECT FROM TABLE 1 WHERE ID IN ('1', '2', '4', '6')

> Also, this behavior does not use string parameters, such as WHERE ID IN 
> (:LIST_ID).

Can't do it that way. Try this:

SELECT FROM TABLE 1 WHERE ID IN (:Item1, :Item2, :Item3)

Or dynamically build your in list using string manipulation in your 
client app. Or use a temporary table.

Kjell
-- 
--------------------------------------
Kjell Rilbe
DataDIA AB
E-post: kj...@datadia.se
Telefon: 08-761 06 55
Mobil: 0733-44 24 64


------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to