Topic: On delete cascade by script

Help for script,
I have 2 tables related and I want to have a delete cascade option in a record.
I use this script but it faild

sqlexecute( 'Update TABLE tele CONSTRAINT FOREIGN_KEY id_Stoixeia  REFERENCES Stoixeia (ID)  ON DELETE CASCADE');

Re: On delete cascade by script

If you are trying to add a field to an existing or deployed application, then try

SQLExecute('ALTER TABLE tele ADD COLUMN [id_Stoixeia] INTEGER REFERENCES [Stoixeia](id) ON DELETE CASCADE')
brian

Re: On delete cascade by script

For SQLite, as far as I know, there is one solution.


Rename original table to orig_temp.
Create a new one with Foreign Key.
Copy/move records to a new table.
Delete the old table as needed.


But this action will most likely require replacing the SQLite library file.