Cursor with arbitrary order

jda jda at his.com
Wed Dec 27 11:04:35 CST 2006


>>Yes you can.
>>
>>I think this is mentioned in WIKI / KERNEL
>
>Hm, I'm trying, but get an error. Here is my  code:
>
>fld = myDatabase.myReferences.createLongField("orderField", 
>EVFlag.fTemporary, "") //create temporary field
>
>   ...
>fill in orderField for each record
>....
>
>   myCursor = myDatabase.SQLSelect("select * from thereferences where 
>id in " + s + " ORDER BY orderField", EVCursorLocation.kServerSide, 
>EVLockType.kReadOnly)
>
>I get the VException: Field "85" does not exist.
>

 From the wiki I see that.ftempoary fields are read-only. Do I tried this

dim fld as VLong

  fld = myDatabase.myReferences.createLongField("orderField", 
EVFlag.fNone, "") //create temporary field

myCursor = myDatabase.SQLSelect("select id,orderField from 
thereferences where id in " + s, EVCursorLocation.kServerSide, 
EVLockType.kReadWrite)

...
enter values for orderField
...

myCursor = nil
myCursor = myDatabase.SQLSelect("select * from thereferences where id 
in " + s + " ORDER BY orderField", EVCursorLocation.kServerSide, 
EVLockType.kReadOnly)

The last query gives me the same error -- field 85 doesn't exist.

If I take out the "ORDER BY orderfield" it works (but of course is useless).

Jon


More information about the Valentina-beta mailing list