About %ROWTYPE in PL/SQL.


关于%ROWTYPE的使用方法,可以简便PL/SQL的写法,而且据说安全。

content:

declare
v_emp emp%rowtype;
cursor c_emp is select * from emp;
begin
open c_emp;
loop
fetch c_emp into v_emp;
exit when c_emp%NOTFOUND;
dbms_output.put_line('Salary of Employee '||v_emp.ename||' is '||v_emp.sal);
end loop;
close c_emp;
end;

Published At
Categories with 数据库类
Tagged with
comments powered by Disqus