I SQL Developer kan du inte kopiera/klistra in det jag skrev (tidigare) i SQL*Plus; du skulle utelämna radnummer (och SQL>
). uppmaningar) och använd endast detta:
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;
/