Monday, September 28, 2009

xml read xpath

create or replace procedure tamjid_xml_read_2 is
x XMLTYPE := XMLTYPE('



12
String

2
2
2
2


2
2
2
2

1967-08-13
14:20:00.0Z
String
1967-08-13
14:20:00.0Z
14:20:00.0Z
2
String
String
String



1967-08-13
1967-08-13
14:20:00.0Z
String
String
String
String
String
String



2

2
2
2
2


2
2
2
2

1967-08-13
1967-08-13
2
2

2
2
2
2

String


1967-08-13
14:20:00.0Z
14:20:00.0Z
String
String

2
2
2
2

2
2
2
2
String
String
2
2
String
String
1
1
String


1

2
2
2
2

**** VALID TEXT REQUIRED ****
123456789123456
aaaaaaaaaaaaaaaaaa

2
2
2
2

aaaaaaaaaaaaaaaaaa
Y
2
0
1


12

2
2
2
2

**** VALID TEXT REQUIRED ****
123456789123456
Y
2
0
12
aaaaaaaaaaaaaaa


1

2
2
2
2

**** VALID TEXT REQUIRED****
0
0
0
0
0
0
0
1
0
0
true
aaaaaaaa



2
2
2
2

**** VALID TEXT REQUIRED****
aa
123456789123456
aaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaa

0
1234
1234
1234
1234

1234
127
1234
a
1
127


0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
aaaaaaaaaaaaaaaaaaaa


2
2
2
2
String



2
2
2
2
2
String



2
2
2
2
String
String


');
begin
FOR i IN ( ( select EXTRACTVALUE(VALUE(t),'/EHR/StandardLevel') b_1,
EXTRACTVALUE(VALUE(t),'/EHR/TestFileInd') b_2,
EXTRACTVALUE(VALUE(t),'/EHR/ECreateDate') b_3,
EXTRACTVALUE(VALUE(t),'/EHR/ECreateTime') b_4,
EXTRACTVALUE(VALUE(t),'/EHR/ResendInd') b_5,
EXTRACTVALUE(VALUE(t),'/EHR/ESettlementDate') b_6,
EXTRACTVALUE(VALUE(t),'/EHR/ESessionTime') b_7,
EXTRACTVALUE(VALUE(t),'/EHR/ESettlementTime') b_8,
EXTRACTVALUE(VALUE(t),'/EHR/EType') b_9,
EXTRACTVALUE(VALUE(t),'/EHR/FileIDMod') b_10,
EXTRACTVALUE(VALUE(t),'/EHR/CountryCode') b_11,
EXTRACTVALUE(VALUE(t),'/EHR/EUsrFld') b_12,
EXTRACTVALUE(VALUE(t),'/EHR/DestRT/BankCode') b_13 ----type
from TABLE(XMLSEQUENCE(EXTRACT(x,'/BACPSInterface/OCE/EHR'))) t)
)

LOOP
dbms_output.put_line('B_1 = ' i.b_1 ' bankCode ' i.b_13);
END LOOP;

END;

No comments: