我想在表mom_moallocate中删除行,但执行代码后提示“未能找到存储过程‘SQL’”,请问怎样解决,代码如下:
procedure TMainForm.Btn_deleteClick(Sender: TObject);
var SQL:string;
var caption,content:string;
begin
caption:='提示';
content:='子件删除成功!';
SQL:='delete from mom_moallocate where invcode in (select cinvcode from inventory where cinvdefine3='+Quotedstr('*')+') and qty<>issqty';
ADOQuery1.SQL.Clear;
ADOQuery1.SQL.Add('SQL');
ADOQuery1.ExecSQL;
messagebox(Handle,Pchar(content),Pchar(caption),MB_ICONASTERISK);
end;
------解决方案--------------------
ADOQuery1.SQL.Add(SQL);去掉引号