SQLite and ZUpdateSQL
Posted: 04.11.2009, 09:50
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
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