How to get last stored record (SOLite) twice?

Reinhold Venzl-Schubert r.venzl-schubert at macbay.de
Mon Sep 14 04:03:00 EDT 2009


Hi!

I store text (Karten_Daten) and images in two different tables of a  
SQLite-Database.
I need the ID of the last stored record of the text to allocate the  
images.
Therefore I use "SELECT MAX(KartenID) FROM Karten_Daten"

Somethimes I get a number, the ID, but sometimes I get "false".
I tested a lot of code and then I found this strange thing:

When send the following code twice on after another to my database I  
got different answers:

    put "SELECT MAX(KartenID) FROM Karten_Daten" into tSQL
    put revdb_querylist(,,gConID,tSQL) into tlastCDimp1
    answer tlastCDimp1

    put "SELECT MAX(KartenID) FROM Karten_Daten" into tSQL
    put revdb_querylist(,,gConID,tSQL) into tlastCDimp2
    answer tlastCDimp2
    	
in the first case tlastCDimp contains a number, but in the second time  
tlastCDimp: "false"

The most strange experience is, that among the hundreds of test I  
made, there had been about two or three where tLastCDimp shows a  
number in both cases. :-(

I do not understand it!

Reinhold

PS: I use a Mac with Snow Leopard. Do this has any influence?



More information about the use-livecode mailing list