create or replace procedure up_pro( 
up_id int 
) is 
uname varchar2(20); 
begin 
select u.phonenum into uname from up u where upid=up_id; 
dbms_output.put_line(uname); end up_pro; 我的调用报错~~ 
说非法的变量名跟变量~ 
调用如下 
begin 
-- Call the procedure 
up_pro(1); 
end; 
请大哥们帮忙看看~

解决方案 »

  1.   

    SQL> ed
    Wrote file afiedt.buf  1  create or replace procedure up_pro(
      2  up_id int
      3  ) is
      4  uname varchar2(20);
      5  begin
      6  select to_char(up_id) into uname from dual;
      7  dbms_output.put_line(uname);
      8* end up_pro;
      9  /Procedure created.SQL> set serverout on
    SQL> begin
      2  up_pro(1);
      3  end;
      4  /
    1PL/SQL procedure successfully completed.SQL>很正确阿
      

  2.   

    你 在哪执行的?在 sqlplus中去执行一下;