CREATE OR REPLACE PROCEDURE "GUOSHUI"."GETCENTERINFO" is aa guoshui.T_L.aa%type; bb guoshui.T_L.bb%type; cursor mycursor is select aa,bb from guoshui.T_L; begin open mycursor; fetch mycursor into aa,bb; dbms_output.put_line(to_char(aa)||to_char(bb)); while mycursor%found loop fetch mycursor into aa,bb; dbms_output.put_line(to_char(aa)||to_char(bb)); end loop; close mycursor; end;
CREATE OR REPLACE PROCEDURE "GUOSHUI"."GETCENTERINFO" is aa guoshui.T_L.aa%type; bb guoshui.T_L.bb%type; begin for cur_aa in (select aa,bb from guoshui.T_L) loop aa := cur_aa.aa; bb := cur_aa.bb; end loop; end;
你可以用TOAD工具中的帮助,里面都是有原码的,记住要安装Knowledge Xpert for PLSQL TOAD工具中自带的.顺便可以练习下英文
is
aa guoshui.T_L.aa%type;
bb guoshui.T_L.bb%type;
cursor mycursor is
select aa,bb from guoshui.T_L;
begin
open mycursor;
fetch mycursor into aa,bb;
dbms_output.put_line(to_char(aa)||to_char(bb));
while mycursor%found loop
fetch mycursor into aa,bb;
dbms_output.put_line(to_char(aa)||to_char(bb));
end loop;
close mycursor;
end;
is
aa guoshui.T_L.aa%type;
bb guoshui.T_L.bb%type;
begin
for cur_aa in (select aa,bb from guoshui.T_L) loop
aa := cur_aa.aa;
bb := cur_aa.bb;
end loop;
end;
TOAD工具中自带的.顺便可以练习下英文