declare
cursor c_bank is select bno,bname from bankt where bno in(select bno from loant);
v_ename let.ename%type;
v_ldate loant.ldate%type;
v_lamount loant.lamount%type;
v_lterm loant.lterm%type;
begin
for c in c_bank loop
dbms_output.put_line(c.bname||'的贷款情况如下:');
dbms_output.put_line('法人名称 贷款日期 贷款金额(万元) 贷款期限(年)');
declare
cursor c_ss is
select ename,ldate,lamount,lterm from let,loant
where let.eno = loant.eno and bno = (select bno from bankt where bname=c.bname) order by ename,ldate;
begin
for cc in c_ss loop
dbms_output.put_line(cc.ename||' '||cc.ldate||' '||cc.lamount||' '||cc.lterm);
end loop;
dbms_output.put_line('');
end;
end loop;
end;
PL/SQL 嵌套declare begin end
最新推荐文章于 2025-02-10 12:06:24 发布