----------过程 create or replace procedure p_sel is v_tb_student tb_student %rowtype; v_tb_class tb_class %rowtype; cursor c_let is select a.* from tb_student a inner join tb_class b on a.tb_student =b.tb_class ; cursor c_lea is select b.* from tb_student a inner join dept b on a.tb_student =b.tb_class ; begin open c_let; open c_lea; loop fetch c_let into v_tb_student ; fetch c_lea into v_tb_class ; exit when c_let%notfound; exit when c_lea%notfound; dbms_output.put_line(你要查询的字段); end loop; close c_let; close c_lea; end;----------------调用 begin p_sel; end;
create or replace procedure p_sel is
v_tb_student tb_student %rowtype;
v_tb_class tb_class %rowtype;
cursor c_let is select a.* from tb_student a inner join tb_class b on a.tb_student =b.tb_class ;
cursor c_lea is select b.* from tb_student a inner join dept b on a.tb_student =b.tb_class ;
begin
open c_let;
open c_lea;
loop
fetch c_let into v_tb_student ;
fetch c_lea into v_tb_class ;
exit when c_let%notfound;
exit when c_lea%notfound;
dbms_output.put_line(你要查询的字段);
end loop;
close c_let;
close c_lea;
end;----------------调用
begin
p_sel;
end;