Advertisement
Guest User

Untitled

a guest
Apr 16th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PL/SQL 1.25 KB | None | 0 0
  1. FUNCTION f_vrni_tabelo_postavk(p_xml_node IN XMLTYPE) RETURN row_postavka PIPELINED IS
  2.     out_rec r_postavka;
  3.     l_stevec NUMBER := 1;
  4.     l_xml_vrstica XMLTYPE;
  5. BEGIN
  6.     LOOP
  7.       l_xml_vrstica := p_xml_node.EXTRACT('/T_POLICA/POSTAVKE/POSTAVKA[' || l_stevec || ']','xmlns="http://www.crea.si/Schemas/2008/AS"');
  8.       EXIT WHEN l_xml_vrstica IS NULL;
  9.       out_rec := NULL;
  10.          out_rec.postavka_id     := f_xml(l_xml_vrstica,'/POSTAVKA/POSTAVKA_ID/text()');
  11.          out_rec.sklop           := f_xml(l_xml_vrstica,'/POSTAVKA/SKLOP/text()');
  12.          out_rec.tip_postavke    := f_xml(l_xml_vrstica,'/POSTAVKA/TIP_POSTAVKE/text()');
  13.          out_rec.paket_id        := f_xml(l_xml_vrstica,'/POSTAVKA/PAKET_ID/text()');
  14.          out_rec.izbrano         := f_xml(l_xml_vrstica,'/POSTAVKA/IZBRANO/text()');
  15.          out_rec.znesek          := f_xml(l_xml_vrstica,'/POSTAVKA/ZNESEK/text()');
  16.          out_rec.odstotek        := f_xml(l_xml_vrstica,'/POSTAVKA/ODSTOTEK/text()');
  17.          out_rec.opis            := f_xml(l_xml_vrstica,'/POSTAVKA/OPIS/text()');
  18.          out_rec.podtip_postavke := f_xml(l_xml_vrstica,'/POSTAVKA/PODTIP_POSTAVKE/text()');
  19.       pipe ROW(out_rec);
  20.       l_stevec := l_stevec + 1;
  21.     END LOOP;
  22. RETURN;
  23. END f_vrni_tabelo_postavk;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement