0

I have two tables Client , Commande

The DDL in sqlite3 is the following ,

CREATE TABLE Client ( 
    id_client  INT              NOT NULL,
    nom        varchar(10),
    PRIMARY KEY ( id_client ) 
);



CREATE TABLE Commande ( 
    id_commande   INT     NOT NULL,
    id_client     INTEGER REFERENCES Client ( id_client ) ON DELETE CASCADE
                                                          ON UPDATE CASCADE,
    PRIMARY KEY ( id_commande ) 


);

i use TzTable1 for Client and TzTable2 for Commande So, When I delete a client from Client table by calling Tztable1.delete ;
, it doesn't delete associated Commandes from Commande Table !!

i dont know where the problem is !!

RRUZ
  • 134,889
  • 20
  • 356
  • 483
Bessoufi Mounir
  • 1,368
  • 1
  • 8
  • 7

1 Answers1

0

I guess you will have to reopen TzTable2 after calling Tztable1.delete to refelct the changes which occur on DB level.

Klaus
  • 11
  • 2
  • i did Both reopening and refreshing Tztable2 but , didn't solve the problem . – Bessoufi Mounir Jun 18 '13 at 16:03
  • Did you close and (re)open TzTable2? if you just call open when the table is already open, the table component most probably won't refetch the data. Can you access the data in another way, too? Did you verify that the data is really deleted as intended? – Klaus Jun 18 '13 at 16:21
  • 1- yes I did , by doing this , Tztable2.close; Tztable2.open; but nothing happned , 2- yes , by using Sqlitestudio v2.1.2 , works fine , when i delete a record in Client all concerned records in Commande deleted also , So i guess the problem is in Zeosdb engin and components !! – Bessoufi Mounir Jun 18 '13 at 16:30