我们在以下链接中提到了类似的问题,但仍无法获得所需的输出,
How to use a variable from a cursor in the select statement of another cursor in pl/sql
**PL/SQL Block:**
begin
for d in (select listagg(''''||deptno||'''',',')
within group(order by deptno) deptno from dept)
loop
for e in (select * from emp where deptno=d.deptno)
loop
dbms_output.put_line( 'Employee ' || e.ename ||
' in department ' || d.dname );
end loop;
end loop;
end;
/
我们无法使用上述pl / sql块生成消息。