hi
I put in my DataModule a component TMYQUERY that is connect to a database, i insert at DesignTime the sql for deleting record...
DELETE FROM progetti
WHERE
DATAULTA = :Old_DATAULTA
In the avent CLICKBOTTON i want delete all the record in the table.
so i think i have to execute the query.... so i do that...
if not SaJConn.InTransaction then
begin
SaJConn.StartTransaction;
TabDel.SQLDelete.Add(TabDel.SQLDelete.CommaText);
TabDel.Execute;
SaJConn.Commit;
end;
**but i think its no the way......someone can help me?
thanks a lot
How to Use MYQuery.SQLDelete........
> In the avent CLICKBOTTON i want delete all the record in the table.
To delete all records from the table you should use something like:
or
The first way is quicker. Please read MySQL Server Reference Manual for detailed information.
About options SQLDelete, SQLUpdate, SQLInsert, SQLRefresh you can read in MyDAC Help. Also you can refer to this link.
To delete all records from the table you should use something like:
Code: Select all
MyQuery.SQL.Text := 'TRUNCATE TABLE TableName';
MyQuery.Execute;Code: Select all
MyQuery.SQL.Text := 'DELETE FROM TableName';
MyQuery.Execute;About options SQLDelete, SQLUpdate, SQLInsert, SQLRefresh you can read in MyDAC Help. Also you can refer to this link.