比如说我要查询出一个select * from tb_student ts inner join tb_class tc on ts.id=tc.studentid
用oracle的pl/sql Develper中如何写存储过程?请给出详细代码和操作步骤,以及测试存储过程的方法。谢谢
------解决方案--------------------
----------过程
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;