我编了一个简单的存储过程 create or replace procedure testYxm 
(
testvalue         out number
)
is  
begin
insert into test1 values(5,'test5') 
returning  1 into testvalue;
commit;
end;
运行老是  无效SQL语句看了半天不知道怎么回事,请指点。

解决方案 »

  1.   

    SQL> set serveroutput on;
    SQL> declare
      2  a number;
      3  begin
      4  testYxm(a);
      5  DBMS_OUTPUT.put_line(a);
      6  end;
      7  /
    1PL/SQL procedure successfully completed
      

  2.   

    insert into test1 values(5,'test5');楼主单独能插入吗?一下代码创建成功。 楼主检查下插入语句..create or replace procedure testYxm ( testvalue out number) 
    is  
    begin 
    insert into d values(5)
    returning 1 into testvalue; 
    commit; 
    end; 
      

  3.   

    我改成这样就好了
    create or replace procedure testYxm 
    is  
    begin 
    insert into test1 values(1,'test');
    commit; 
    end;但我又写了一个 
    create or replace procedure yxm.testyxm
    is
    begin
    create table test55(sid number, sname  varchar2(20));
    commit;
    end; 
    还是 创建的过程带有编译错误 
    怎么回事呀
      

  4.   

    过程中不能用DDL语句,如果要建表,换成动态语句begin
    execute immediate 'create table test55(sid number, sname  varchar2(20))';
    commit;
    ..