Insert value to a table after calculation
SQL> create table sales(
2 gift_id number(5),
3 order_total number(11,2)
4 );
Table created.
SQL>
SQL> declare
2 v_order_total sales.order_total%type;
3 begin
4 for i in 1..100 loop
5 v_order_total := i * 1.10;
6 insert into sales values (i, v_order_total);
7 end loop;
8 end;
9 /
PL/SQL procedure successfully completed.
SQL>
SQL> drop table sales;
Table dropped.
Related examples in the same category