Topic: Delete (clear) Multiple Tables that are Connected with other Tables
Hi All, hope you guys can help or lead me to the right direction.
Now that I've built an application, I would like to share it with people at work. With one click at a hidden button, I could the necessary tables and clear the tables. I've tried this code as a test in a testing environment.
procedure fmMainMenu_Button7_OnClick (Sender: TObject; var Cancel: boolean);
begin
SQLExecute('DELETE FROM dtTimeTableListing');
end;
Yet I get the following message:
Error Message
FFOREIGN KEY constraint failed
Script: SQLExecute.
I am assuming the cause is links between other tables ? !
I've done as much research as my "PROGRAMMER WANT-TO-BE" brain can handle and would need simple coding to clear tables I think i need to before it becomes too spaghetti programming for my mind.
Also, am I on the right track to think, that one needs clear the links of secondary tables that feed to a main table ? (Does my sentence may any sense ?)
Thanks for your help everybody.