Hi!
In MyQuery generates me an DELETESQL: DELETE FROM table WHERE id=:OLD_ID
works fine if I want to delete selected record like MYQUERY.DELETE;.
Now I want to delete like this
DELETE FROM table WHERE id_secondtable=:idfromsecondtable
Yes I can put new QUERY on my form and write this SQL in it and do MYnewQUERY.CLOSE;
MYnewQUERYOPEN;
but I don't want to create new query, I want to use my old QUERY and use QUERY.DELETE option.
how to do this?
Is there any tutorials or demo programs how to do different things with MYQUERY ?
Thanks!
DELETE RECORD WITH SPECIFIC VALUE
DeleteSQL is intended for execution when deleting current record of the record set. You can use ExecSQL method of TMyConnection component to execute DElETE statement. For example:
MyQuery.Connection.ExecSQL('DELETE FROM table WHERE id=1234', []);
The second way is usage of TMyCommand component.
> Is there any tutorials or demo programs how to do different things with MYQUERY ?
You can find MyDAC demos in %MyDAC%\Demos\ directory.
%MyDac% is the MyDAC installation path on your computer.
MyQuery.Connection.ExecSQL('DELETE FROM table WHERE id=1234', []);
The second way is usage of TMyCommand component.
> Is there any tutorials or demo programs how to do different things with MYQUERY ?
You can find MyDAC demos in %MyDAC%\Demos\ directory.
%MyDac% is the MyDAC installation path on your computer.