Технология Клиент-Сервер 1999'3 |
|||||||
|
Этот PL/SQL код заполняет временную реляционную таблицу PC данными иэ вложенной таблицы PO_LINE_TAB.
declare t1 line_item_list_t; stk stock_info_t; cursor c1 is select p.pono, p.line_item_list pl from purchase_tab p; begin for crec in c1 LOOP t1 := crec.pl; for i in 1..t1.count LOOP dbms_output.put_line('PO ' || crec.pono || ' Line ' || t1(i).lineitemno); -- The dref can not be directly used in plsql -- stk := deref(...) is illegal select deref(t1(i).stockref) into stk from dual; dbms_output.put_line('PO ' || crec.pono || ' Cost ' || stk.cost); insert into pc (lino, stockno, cost, tax_code, quantity, discount, pono) values (t1(i).lineitemno, stk.stockno, stk.cost, stk.tax_code, t1(i).quantity, t1(i).discount, crec.pono); end loop; end loop; commit; end; /
Copyright © 1994-2016 ООО "К-Пресс"