<html><body><div style="color:#000; background-color:#fff; font-family:lucida console, sans-serif;font-size:10pt"><div><span>ivan,</span></div><div><span>thanks for the info!</span></div><div><span>any word on when the </span><span style="font-family: 'times new roman', 'new york', times, serif; font-size: 16px; ">"select * from t where INCLUDE_ITEM( :1, agencyid)" </span><span style="font-size: 10pt; ">feature will be available? </span></div><div><span>george</span></div><div><span><br></span></div><div><br></div> <div style="font-size: 10pt; font-family: 'lucida console', sans-serif; "> <div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "> <div dir="ltr"> <font size="2" face="Arial"> <hr size="1"> <b><span style="font-weight:bold;">From:</span></b> Ivan Smahin <ivan_smahin@paradigmasoft.com><br> <b><span style="font-weight: bold;">To:</span></b> Valentina Developers
<valentina@lists.macserve.net> <br> <b><span style="font-weight: bold;">Sent:</span></b> Thursday, July 26, 2012 5:51:17 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: array binding with 'IN' statement<br> </font> </div> <br><div id="yiv1323924878"><div><br><div><div>On Jul 26, 2012, at 11:19 AM, Ivan Smahin wrote:</div><br class="yiv1323924878Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap:break-word;"><br><div><div>On Jul 25, 2012, at 9:32 PM, George Parkinson wrote:</div><br class="yiv1323924878Apple-interchange-newline"><blockquote type="cite"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 10pt; font-family: sans-serif; "><div><div><div><font size="2" style="font-family: arial, helvetica, sans-serif; ">hello all,</font></div><div><font size="2" style="font-family: arial, helvetica, sans-serif; ">i'm not sure what to make of this...</font></div><div><font
size="2" style="font-family: arial, helvetica, sans-serif; "><br></font></div><div><font size="2" style="font-family: arial, helvetica, sans-serif; ">"SELECT * FROM t WHERE t.AgencyID in (996,998,1195)"</font></div><div><font size="2" style="font-family: arial, helvetica, sans-serif; ">returns all records where AgencyID one of 996, 998, or 1195...no problem here.</font></div><div><font size="2" style="font-family: arial, helvetica, sans-serif; "><br></font></div><div><font size="2" style="font-family: arial, helvetica, sans-serif; ">now, let's say i have an array-> SqlBind(1) =
"996,998,1195"</font></div><div><font size="2" style="font-family: arial, helvetica, sans-serif; ">and i use this format -> <span class="yiv1323924878Apple-tab-span" style="white-space:pre;"> </span> "SELECT * FROM t WHERE t.agencyid IN (:1)"</font></div><div><font size="2" style="font-family: arial, helvetica, sans-serif; "><br></font></div><div><font size="2" style="font-family: arial, helvetica, sans-serif; ">when i run:</font></div><div><font size="2" style="font-family: arial, helvetica, sans-serif; ">db.SqlSelect(SQLQuery, kClientSide, kNoLocks, kForwardOnly, SQLBind)</font></div><div><font size="2" style="font-family: arial, helvetica, sans-serif; ">only records where t.AgencyID = 996 are returned.</font></div><div><font size="2" style="font-family: arial, helvetica, sans-serif; "><br></font></div><div><font size="2" style="font-family: arial, helvetica, sans-serif; ">is this normal?</font></div><div><font size="2"
style="font-family: arial, helvetica, sans-serif; ">can't binding be used with "IN"?</font></div><div><font size="2" style="font-family: arial, helvetica, sans-serif; "><br></font></div><div><font size="2" style="font-family: arial, helvetica, sans-serif; ">thanks,</font></div><div><font size="2" style="font-family: arial, helvetica, sans-serif; ">george</font></div><div><font size="2" style="font-family: arial, helvetica, sans-serif; "><br></font></div><div><br></div></div></div></div></div></blockquote></div><div><br></div><div>One more option to play with:</div><div><br></div><div><a rel="nofollow" target="_blank" href="http://www.valentina-db.com/dokuwiki5/doku.php?id=valentina:vcomponents:vsql:reference:expr:funcs_collections">http://www.valentina-db.com/dokuwiki5/doku.php?id=valentina:vcomponents:vsql:reference:expr:funcs_collections</a></div><div><br></div><div>something like</div><div><br></div><div>"select * from t where INCLUDE_ITEM( :1,
agencyid)"</div><div><br></div><div>with</div><div><blockquote type="cite"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-size: 10pt; font-family: sans-serif; "><div><div><div><font size="2" style="font-family: arial, helvetica, sans-serif; ">SqlBind(1) = "996,998,1195"</font></div></div></div></div></div></blockquote></div><div><br></div></div></blockquote></div><div><br></div>Ups, sorry - it is "TODO" yet feature.<div>Anyway you can write own sql-function which will take a list of values (as a single string value)</div><div>and check that current field value is in that list.</div><div><br></div><div><a rel="nofollow" target="_blank" href="http://www.valentina-db.com/dokuwiki5/doku.php?id=valentina:vcomponents:vsql:reference:expr:funcs_lists">http://www.valentina-db.com/dokuwiki5/doku.php?id=valentina:vcomponents:vsql:reference:expr:funcs_lists</a></div><div><div>function for working with
lists.</div><div><br></div><div>But it could be pretty slow solution because of each candidate record must be checked - no index searches and so on. Personally I would prefer "query-concat" way.</div><div> </div><div><br><div>
<div>-- <br>Best regards,<br>Ivan Smahin<br>Senior Software Engineer<br>Paradigma Software, Inc<br>Valentina - The Ultra-Fast Database<br><a rel="nofollow" target="_blank" href="http://www.valentina-db.com/">http://www.valentina-db.com</a></div>
</div>
<br></div></div></div></div><br>_______________________________________________<br>Valentina mailing list<br><a ymailto="mailto:Valentina@lists.macserve.net" href="mailto:Valentina@lists.macserve.net">Valentina@lists.macserve.net</a><br><a href="http://lists.macserve.net/mailman/listinfo/valentina" target="_blank">http://lists.macserve.net/mailman/listinfo/valentina</a><br><br><br> </div> </div> </div></body></html>