declare
v_result number(80);
begin
for cur in (select distinct no from table )
loop
v_result:=cur.no;
dbms_output.put_line('工号为'||v_result);
end loop;
end ;
大家帮忙看看这有没有错误就是把所有的员工工号打出来!
v_result number(80);
begin
for cur in (select distinct no from table )
loop
v_result:=cur.no;
dbms_output.put_line('工号为'||v_result);
end loop;
end ;
大家帮忙看看这有没有错误就是把所有的员工工号打出来!
v_result number(80);
CURSOR curs is
select distinct no from table;
begin
for c_cur in curs loop
v_result:=cur.no;
dbms_output.put_line('工号为:'||to_char(v_result));
end loop;
exception
when others then
dbms_output.put_line(substr(sqlerrm,1,255));
end ;