使用plsql语句和游标循环打印出emp表中所有人的姓名和工资。急急急!!!谢谢

2025-03-04 11:45:03
推荐回答(1个)
回答1:

代码:

declare
  cursor c_job is
    select ename, sal from emp;
  c_row c_job%rowtype;
begin
  for c_row in c_job loop
    dbms_output.put_line('姓名:' || c_row.ename || ' 工资:' || c_row.sal);
  end loop;
end;

结果: