#1 2011-11-25 15:13:07

jonsafi
Member
Registered: 2011-07-26
Posts: 58

Deleting with a dynamic query...

Hello, was trying to delete hundreds of rows from
a table based on a date value. Tried first
retrieving the row matching the date and then
deleting the rows using:

BatchDelete
BatchSend
followed by Commit.
This returned success (200)
but for some reason the rows were not removed.

Anyhow am now trying to use the following simpler way:

Var
sql8:putf8Char;
where_str:AnsiString;

where_str  := 'date(datetaken) > '2010-10-15''';
sql8            := 'DELETE FROM MYTABLE WHERE ' + where_str;
globalClient.EngineExecuteFmt(sql8,[]);

This code will not compile, because of a type error.
Could not find any easy way of converting a string to
putf8Char. Could you please help me out here?

Thanks a lot for any pointers.
Regards,
Sami

Offline

#2 2011-11-30 10:09:26

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,659
Website

Re: Deleting with a dynamic query...

Did you create a transaction first?

Offline

Board footer

Powered by FluxBB