Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
test de xmltable
declare
v varchar2(32000) := '
<r>
<k1>dddd</k1>
<k2>dddd</k2>
<k3>dddd</k3>
<k4>dddd</k4>
<k5>dddd</k5>
<k6>dddd</k6>
<k7>dddd</k7>
<k8>dddd</k8>
</r>';
k1 varchar(10);
k2 varchar(10);
k3 varchar(10);
k4 varchar(10);
k5 varchar(10);
k6 varchar(10);
k7 varchar(10);
k8 varchar(10);
t1 number := Dbms_Utility.Get_Time;
t2 number := Dbms_Utility.Get_Time;
v2 xmltype;
begin
for i in 1.. 1000 loop
select
* into k1,k2,k3,k4,k5,k6,k7,k8
from xmltable('/r'
passing xmltype(v)
columns
k1 varchar2(10) path 'k1',
k2 varchar2(10) path 'k2',
k3 varchar2(10) path 'k3',
k4 varchar2(10) path 'k4',
k5 varchar2(10) path 'k5',
k6 varchar2(10) path 'k6',
k7 varchar2(10) path 'k7',
k8 varchar2(10) path 'k8');
end loop;
t2 := Dbms_Utility.Get_Time;
dbms_output.put_line((t2-t1)/1000*10 || 'ms./por llamada');
end;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.