declare
v_name text.name%type;
v_age text.age%type;
cursor text is
select name,age from text;
begin
open text;
loop
fetch text into v_name,v_age;
exit when text%notfound;
dbms_output.put_line(v_name||"对应"||v_age);
end loop;
close text;
end;
v_name text.name%type;
v_age text.age%type;
cursor text is
select name,age from text;
begin
open text;
loop
fetch text into v_name,v_age;
exit when text%notfound;
dbms_output.put_line(v_name||"对应"||v_age);
end loop;
close text;
end;
字符用单引号
dbms_output.put_line(v_name||'对应'||v_age);
declare
v_name text.name%type;
v_age text.age%type;
cursor c_text is select name,age from text; --不要把游标名跟表名一样
begin
open c_text;
loop
fetch c_text into v_name,v_age;
exit when c_text%notfound;
dbms_output.put_line(v_name||'对应'||v_age); ---单引号
end loop;
close c_text;
end;
v_name text.name%type;
v_age text.age%type;
cursor text is
select name,age from text;
begin
open text;
loop
fetch text into v_name,v_age;
exit when text%notfound;
dbms_output.put_line(v_name||'对应'||v_age);
end loop;
close text;
end;