错误:procedure已经建立了,有编译错误

解决方案 »

  1.   

    我执行execute set_death_age('LiBai',60);
    出错信息:LiBai和60作为期待的目标不能使用*****************************************************我的存储过程:
    set serveroutput oncreate procedure set_death_age
    (
    poet in out VARCHAR2,
    poet_age in out NUMBER
    ) as
    poet_id NUMBER;
    begin 
    SELECT id INTO poet_id FROM poets WHERE name = poet;
    INSERT INTO deaths (id, age) VALUES (poet_id, poet_age);
    end set_death_age; 
    /我的两个表的结构:
    desc poets
    ID        NOT NULL NUMBET(3)
    NAME               VARCHAR2(10)
    desc deaths
    ID        NOT NULL NUMBER(3)
    AGE                NUMBER(3)表poets有两条纪录:
    111 LiBai
    112 DuFu
    表deaths没有纪录
      

  2.   

    set serveroutput oncreate procedure set_death_age
    (
    poet in VARCHAR2,
    poet_age in NUMBER
    ) is
    poet_id NUMBER;
    begin 
    SELECT id INTO poet_id FROM poets WHERE name = poet;
    INSERT INTO deaths (id, age) VALUES (poet_id, poet_age);
    end set_death_age;
      

  3.   

    create procedure set_death_age改为:
    create or replace procedure set_death_age
    因为你可能已经建立了一个同名字的过程了,无法再建立一个
      

  4.   

    是as嘛?我记得是is呀,是不是没有提交commit,
      

  5.   

    我把参数类型从in out改为in,就可以了。是什么原因呢?
      

  6.   

    呵呵,是啊。可是我在网上每找到in out 的很好的解释和例子。
    各位谁有资料能给俺一份?
      

  7.   

    in out表示既可以作为传人值也可以作为输出值