Subject | Delete SQL |
---|---|
Author | Paul Hoshovsky |
Post date | 2001-10-24T10:24:10Z |
Hi
After modifying Tutorial1 (yes that's where I am now), I am confused as to
how to eliminate the 'cannot delete current row' error.
The first part of the following code works just fine. It's when I try to
execute the delete then the error occurs.
I apologise for the simplistic problem as I have been out of the
BDE/Interbase for quite a while.
Thanks
--------------
procedure TfrmTutorial1.Button2Click(Sender: TObject);
begin
with ib_query1 do
begin
insertSql.clear;
InsertSql.add('insert into mytest (barcode) values
('+chr(39)+'hello2'+chr(39)+')');
edit;
insert;
post;
close;
deleteSql.clear;
deleteSql.add('delete from mytest where barcode
='+chr(39)+'hello1'+chr(39));
open;
edit;
// execute; <<<< --- which works? Or should I use Stored Proc to
achieve this ?
delete; <<<- error here
close;
end;
After modifying Tutorial1 (yes that's where I am now), I am confused as to
how to eliminate the 'cannot delete current row' error.
The first part of the following code works just fine. It's when I try to
execute the delete then the error occurs.
I apologise for the simplistic problem as I have been out of the
BDE/Interbase for quite a while.
Thanks
--------------
procedure TfrmTutorial1.Button2Click(Sender: TObject);
begin
with ib_query1 do
begin
insertSql.clear;
InsertSql.add('insert into mytest (barcode) values
('+chr(39)+'hello2'+chr(39)+')');
edit;
insert;
post;
close;
deleteSql.clear;
deleteSql.add('delete from mytest where barcode
='+chr(39)+'hello1'+chr(39));
open;
edit;
// execute; <<<< --- which works? Or should I use Stored Proc to
achieve this ?
delete; <<<- error here
close;
end;