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

求解释!!!!!急求!!!!!!!!!!!!
declare
name emp.ename%type;
eall emp%rowtype;
begin
name:=&name;
select * into eall from emp where ename=ena;
dbms_output.put_line(eall.empno||' '||eall.ename||' '||eall.job||' '||eall.mgr||' '||eall.hiredate||' '||eall.sal
||' '||eall.comm||' '||eall.deptno);
exception
when no_data_found then
dbms_output.put_line('not found data');
end;
在name:=&name;
这句老是报错,谁给解释一下?

------解决方案--------------------
SQL code

SQL> declare
  2  eall emp%rowtype;
  3  begin
  4  select * into eall from emp where ename='&name';
  5  dbms_output.put_line(eall.empno||' '||eall.ename||' '||eall.job||' '||eall.mgr||' '||eall.hiredate||' '||eall.sal
  6  ||' '||eall.comm||' '||eall.deptno);
  7  exception
  8  when no_data_found then
  9  dbms_output.put_line('not found data');
 10  end;
 11  /
输入 name 的值:  Smith
7369 Smith CLERK 7902 17-12月-80 800  20                                        

PL/SQL 过程已成功完成。