array binding with 'IN' statement
Ivan Smahin
ivan_smahin at paradigmasoft.com
Thu Jul 26 03:19:48 CDT 2012
On Jul 25, 2012, at 9:32 PM, George Parkinson wrote:
> hello all,
> i'm not sure what to make of this...
>
> "SELECT * FROM t WHERE t.AgencyID in (996,998,1195)"
> returns all records where AgencyID one of 996, 998, or 1195...no problem here.
>
> now, let's say i have an array-> SqlBind(1) = "996,998,1195"
> and i use this format -> "SELECT * FROM t WHERE t.agencyid IN (:1)"
>
> when i run:
> db.SqlSelect(SQLQuery, kClientSide, kNoLocks, kForwardOnly, SQLBind)
> only records where t.AgencyID = 996 are returned.
>
> is this normal?
> can't binding be used with "IN"?
>
> thanks,
> george
>
>
One more option to play with:
http://www.valentina-db.com/dokuwiki5/doku.php?id=valentina:vcomponents:vsql:reference:expr:funcs_collections
something like
"select * from t where INCLUDE_ITEM( :1, agencyid)"
with
> SqlBind(1) = "996,998,1195"
--
Best regards,
Ivan Smahin
Senior Software Engineer
Paradigma Software, Inc
Valentina - The Ultra-Fast Database
http://www.valentina-db.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macserve.net/pipermail/valentina/attachments/20120726/82baea83/attachment.html>
More information about the Valentina
mailing list