CREATE OR REPLACE PROCEDURE ENTSVR.SP_GRAPHREPORT1
(   p_CorpID IN VARCHAR2 default NULL,
        p_StoreID IN VARCHAR2 default NULL,
        p_ComputerName IN VARCHAR2 default NULL
)    
isbegin
     DELETE  FROM GraphReportTable 
          WHERE CORPID = p_CorpID 
          AND STOREID = p_StoreID
         AND ComputerName = p_ComputerName ; 
END SP_GRAPHREPORT1;
/
为什么编译可以通过,但是delete语句没有执行呀?
把参数换成固定的值就可以删除,为什么呀,哪位大侠帮帮忙吧??

解决方案 »

  1.   

    把你的参数打印出来,看传递进来的参数是否有问题!
    dbms_output.put_line(p_CorpID);
    dbms_output.put_line(p_StoreID);
    dbms_output.put_line(p_ComputerName);
      

  2.   

    存储过程中没有提交?如果没有提交,在其它会话中是看不到已删除的。
    删除后commit;
      

  3.   


    SQL> create table t as
      2  select '1001' id,'james' name from dual union all
      3  select '1002','scott' from dual union all
      4  select '1003','john' from dual union all
      5  select '1004','hellen' from dual
      6  /
     
    Table created
     
    SQL> commit
      2  /
     
    Commit complete
     
    SQL> select * from t;
     
    ID   NAME
    ---- ------
    1001 james
    1002 scott
    1003 john
    1004 hellen
     
    SQL> 
    SQL> create or replace procedure pro_delete(id_in t.id%type)
      2  as
      3  begin
      4       delete from t
      5       where id=id_in;
      6  end pro_delete;
      7  /
     
    Procedure created
     
    SQL> commit;
     
    Commit complete
     
    SQL> exec pro_delete('1001');
     
    PL/SQL procedure successfully completed
     
    SQL> select * from t;
     
    ID   NAME
    ---- ------
    1002 scott
    1003 john
    1004 hellen
      

  4.   


    SQL> exec pro_delete('1004');
     
    PL/SQL procedure successfully completed
     
    SQL> select * from t;
     
    ID   NAME
    ---- ------
    1002 scott
    1003 john