In SQL Developer non puoi copiare/incollare ciò che ho scritto (in precedenza) in SQL*Plus; ometteresti i numeri di riga (e SQL>
prompt) e utilizzare solo questo:
set serveroutput on
begin
for cur_r in
(select order_id, ship_via as company_name, order_date
from orders
where order_date < trunc(sysdate)
and rownum <= 5
)
loop
dbms_output.put_line('------------');
dbms_output.put_line('Order ID = ' || cur_r.order_id);
dbms_output.put_line('Order date = ' || to_char(cur_r.order_date, 'dd.mm.yyyy'));
dbms_output.put_line('Company = ' || cur_r.company_name);
end loop;
end;
/