一条Delete语句,在Oracle里很快就运行完了,在程序里为什么ExecSQL半天也没响应?
可能是什么原因?SmartQuery1.Session := OraSession1;
    with  SmartQuery1 do
        begin
            SQL.Clear;
            SQL.Add('delete from table where name='''+ DBLookupListBox1.KeyValue +''' and ID= '''+ Trim(ID.Text)+'''');
            SQL.Text;
            ExecSQL;
        end;

解决方案 »

  1.   

    有没报什么错啊,在你SQL.Clear; 之前少了一句close;哦,你加上去试试
      

  2.   

    加这一句干吗?SQL.Text; 去掉
    如果用SQL.Text就不用Add,SQL.Clear也可以省略了
    不习惯用ADD,麻烦
      

  3.   

    SmartQuery1.Session := OraSession1;
        with  SmartQuery1 do
            begin
                Close;
                SQL.text := 'delete from table where name='''+ DBLookupListBox1.KeyValue +''' and ID= '''+ Trim(ID.Text)+'''';
                ExecSQL;
            end;这样执行试试

    SmartQuery1.Session := OraSession1;
        with  SmartQuery1 do
            begin
                Close;
                SQL.text := 'delete from table where name=:name and id=:ID';
                ParamByName('name').value := DBLookupListBox1.KeyValue;
                ParamByName('ID').value := Trim(ID.Text);
                ExecSQL;
            end;  
      

  4.   

    楼上的方法我试了,还是不行,也不报错,调试到ExecSQL的时候就死在那不动了
      

  5.   

    table ?这是你的表名么?showmessage(SQL.Text);看看里面的内容,拷贝到pl/sql里面执行一下看看是否可以删除
      

  6.   

    只能按月亮说的把sql.text内容截出来查看原因了
      

  7.   

    一开始就已经说过了,sql.text里的内容没问题啊