日期:2014-05-17  浏览次数:20856 次

oracle新手问题
初学oracle procedure,在pl/sql new下创建的procedure中代码
create or replace procedure yangyyy(emp_no in number:=1) 
as
empname varchar2(20);
begin
select NAME_ into empname from T_TTT where ID_ = emp_no;
dbms_output.put_line('雇员姓名是 '||empname);
exception
when no_data_found then
dbms_output.put_line('雇员编号未找到');
end yangyyy;

然后点了execute后显示Complied successful
但是在命令提示符下
create or replace procedure yangyyy(emp_no in number:=1) 
as
empname varchar2(20);
begin
select NAME_ into empname from T_TTT where ID_ = emp_no;
dbms_output.put_line('雇员姓名是 '||empname);
exception
when no_data_found then
dbms_output.put_line('雇员编号未找到');
end yangyyy;
/

就一直显示Warning: Procedure created with compilation errors.
其中表T_TTT有三个字段,ID_,AGE_,NAME_,分别为number,number,和varchar2(20)。请问为什么一直会显示Warning: Procedure created with compilation errors.
非常感谢

------解决方案--------------------
根据错误自己调试吧