Forum Stats

  • 3,752,058 Users
  • 2,250,452 Discussions
  • 7,867,705 Comments

Discussions

java code to read XML data from table

Robeen
Robeen Member Posts: 2,066 Silver Badge

Oracle DB 12.1.0.2

Hello Team,

Is there any java code to read XML data from a table?

SQL we use XML table as shown below:

select account_link_code_n,address_type_n,account_type_v,wfl.*
from cb_address_xml,
xmltable(
'ADDRESS_DTLS'
passing ADDRESS_X
columns
ACCOUNT_TYPE varchar2(10)  path '@ACCOUNT_TYPE ',
ADDRESS_FORMAT varchar2(10) path '@ADDRESS_FORMAT',
ADDRESS_TYPE number(2) path '@ADDRESS_TYPE',
BUILDING varchar2(5) path '@CITY',
CITY varchar2(5) path '@BUILDING' ,
CITY_DESC varchar2(10) path '@CITY_DESC',
COUNTRY varchar2(10) path '@COUNTRY',
COUNTRY_DESC varchar2(10) path '@COUNTRY_DESC',
DISTRICT varchar2(10) path '@DISTRICT',
DISTRICT_DESC varchar2(10) path '@DISTRICT_DESC',
FLOOR varchar2(15) path '@FLOOR',
LANDMARK varchar2(10) path '@LANDMARK',
POSTAL_CODE varchar2(15) path '@POSTAL_CODE',
PO_CODE int path '@PO_CODE',
STREET varchar2(15) path '@STREET',
STREET_DESC varchar2(15) path '@STREET_DESC',
SUB_LOCALITY_CODE varchar2(15) path '@SUB_LOCALITY_CODE',
SUB_LOCALITY_DESC varchar2(15) path '@SUB_LOCALITY_DESC'
) wfl

Thanks,

Roshan