SQLite revQueryDatabase "where" param won't detect invalid target

Paul Murray mr.prmurray at gmail.com
Wed Nov 19 00:14:36 EST 2008


When trying to detect that an entry in a table is missing, revQueryDatabase
"SELECT... WHERE..." is returning an integer (cursor) result when the table
is actually empty or the search value has never been inserted into the
table:

The following code is preceded by the creation of the table before any
records are inserted:

put "SELECT * FROM players WHERE playerID=:1" into doSQL
put "abc1234" into anonID
put revQuerydatabase(wgdbConID,doSQL,"anonID") into playersCursor
answer doSQL & ":" & anonID &" result = " & playersCursor  -- shows the
result (playersCursor value is always an integer)

The result (playersCursor) is ALWAYS an integer, no matter if there are any
entries in the table or not, and no matter what value is given to the anonID
variable.

I need to be able to determine if the record with the specified "playerID"
exists or not.
Does anyone have any idea where the problem is?
Any help would be greatly appreciated.  Thanks.



More information about the use-livecode mailing list