SQLite and ZUpdateSQL

Forum related to SQLite

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
Josef Koller
Junior Boarder
Junior Boarder
Posts: 26
Joined: 04.09.2005, 14:46

SQLite and ZUpdateSQL

Post by Josef Koller »

Hello,

I have problems to get datas into a sqlite DB table.
I use Delphi 6, ZEOS 664 and SQLite 3.

I have the following test construction:

ZConnention1 (chanced the following properties in designtime):

DataBase:= C:\Projekte\delphi_fdbembedded\Test_sqLIte\IMKEREI
Protocol:= sqlite-3
TransactInsolationLavel:=tiReadCommitted;
connecteded :=true;

ZQuery1 (chanced the following properties in designtime):

Connection:= ZConnection1
SQL:= Select * from TBGRUND
UpdateObject:=ZUpdateSQL1
CacheUpdates:=true (if I change to false there is an error SQL logic errror or missing database by insert datas)

ZUpdateSQL1 (chanced the following properties in designtime):
doubleclick to the component than clicking the buttons from top to bottom.

I get the following statements:

DeleteSQL:
DELETE FROM TBGRUND
WHERE
((TBGRUND.GR_ID IS NULL AND :OLD_GR_ID IS NULL) OR
(TBGRUND.GR_ID = :OLD_GR_ID))

InserSQL:
INSERT INTO TBGRUND
(GR_ID, FIRMENBEZEICHNUNG, ....)
VALUES
(GR_ID, FIRMENBEZEICHNUNG, ....)

ModifySQL:
UPDATE TBGRUND SET
GR_ID = :GR_ID,
FIRMENBEZEICHNUNG = :FIRMENBEZEICHNUNG,
...
WHERE
((TBGRUND.GR_ID IS NULL AND :OLD_GR_ID IS NULL) OR
(TBGRUND.GR_ID = :OLD_GR_ID))

After start application I insert or update or delete datas with a dbgrid and a dbnavigator (connected with datasource to ZQuery1).

I see the new inserted row (without a ID), I see the modified row and delete will be ok.

But after restart there are no new datas in the db table or there are no updated datas and the deleted datas are always in the db, too.

What I have to do or to change to work correct with this construction?

Thanks for help.

Best regards

Josef
User avatar
mdaems
Zeos Project Manager
Zeos Project Manager
Posts: 2766
Joined: 20.09.2005, 15:28
Location: Brussels, Belgium
Contact:

Post by mdaems »

Josef,

Does the TZSQLMonitor show these statements being sent to the server?
If yes, there may be some problem with commits. Is a commit in the log after the update/insert/delete statements?

Mark
Image
Post Reply