Hi,
I have a b4A application with Sqllite database.
I have 2 tables in Sqllite.. 1 Master Table (say tbl_Master) and 1 Transaction Table.
The Transaction Table is created with
...Constraint fk_KeyName Foreign Key(the_ID) References tbl_Master(the_ID) on delete cascade...
But when I delete the records from the Master Table, the records in the Transaction Table does not get deleted.
Note: I am using 'Delete from tbl_Master where the_ID=<key value>'
1) Whether I have to use 'Delete Cascade'and if yes.. what is the right way to use it ?
2) Documentation for Sqllite says that the 'Pragma foreign_keys=on' has to be set for every session before the Delete is executed... So how does one set a 'Pragma foreign_keys=on' always and not for every session for the SQLLITE database residing inside the Mobile?
3) If it is not possible to do the above Pragma setting permanently for the sqllite db residing inside the APP, then how should one execute 'Pragma foreign_keys=ON' followed by the 'Delete command' in a b4A app ?
Requesting for guidance on the same,
Thanks
I have a b4A application with Sqllite database.
I have 2 tables in Sqllite.. 1 Master Table (say tbl_Master) and 1 Transaction Table.
The Transaction Table is created with
...Constraint fk_KeyName Foreign Key(the_ID) References tbl_Master(the_ID) on delete cascade...
But when I delete the records from the Master Table, the records in the Transaction Table does not get deleted.
Note: I am using 'Delete from tbl_Master where the_ID=<key value>'
1) Whether I have to use 'Delete Cascade'and if yes.. what is the right way to use it ?
2) Documentation for Sqllite says that the 'Pragma foreign_keys=on' has to be set for every session before the Delete is executed... So how does one set a 'Pragma foreign_keys=on' always and not for every session for the SQLLITE database residing inside the Mobile?
3) If it is not possible to do the above Pragma setting permanently for the sqllite db residing inside the APP, then how should one execute 'Pragma foreign_keys=ON' followed by the 'Delete command' in a b4A app ?
Requesting for guidance on the same,
Thanks