[vxcmd] - 'where recid in' problem?

Ruslan Zasukhin sunshine at public.kherson.ua
Thu Jul 24 07:58:52 CDT 2003


on 7/24/03 6:15, Ron at rbarber at yhb.att.ne.jp wrote:

Hi Ron,

> I have been sending a list of line numbers delimited by a comma to Val. The
> line numbers are the same as the recid IN THIS CASE ONLY since the data is
> never changed. (I recognize the danger of equating line numbers with recids
> ;)
> 
> Recently I changed from:
> 
> repeat for each item x in thelist
>    put Valentina("Cursor_GetRecord",CursorRef,x) & return after newtext
> end repeat
> 
> To:
> 
> put "select ref,verses from bible where recid in "& thelist into thesql
> put Valentina("DataBase_SQLSelectRecords",dbRef,theSQL) into newtext
> 
> I noticed 2 things.
> 
> 1. The 'where recid in' returned the items in numerical order, rather than
> the order of the items. eg; parameter passed = 2,5,1 but returns lines
> 1,2,5. Sometimes I need the item order. I can script around this but is this
> the expected behavior?

In fact yes.

SQL in general do not promise you nothing about order.
Only you can control it suing ORDER BY.
 
> 2. The 'where recid in' did not return all the items when more than a few
> (18 or more, I did not try to find the limit)  randomly ordered items were
> passed to it. This is a bigger problem than no.1 obviously.

You mean long lists fail?

Okay I will check.

-- 
Best regards,
Ruslan Zasukhin      [ I feel the need...the need for speed ]
-------------------------------------------------------------
e-mail: ruslan at paradigmasoft.com
web: http://www.paradigmasoft.com

To subscribe to the Valentina mail list go to:
http://lists.macserve.net/mailman/listinfo/valentina
-------------------------------------------------------------



More information about the Valentina mailing list