cancel
Showing results for 
Search instead for 
Did you mean: 

Read XMLTYPE from Oracle table

former_member192939
Active Participant
0 Kudos

Anyone has success reading Oracle data type XMLTYPE.

select all query returns all other columns but the XMLTYPE column is blank

MII - 12.1.9

Thanks

Ajay

Edited by: Ajay Malempati on Dec 8, 2011 10:50 AM

Accepted Solutions (1)

Accepted Solutions (1)

jcgood25
Active Contributor
0 Kudos

Have you tried doing a TO_CHAR(XMLColumn) AS StringXMLColumn on the column to see if string conversion does the trick?

former_member192939
Active Participant
0 Kudos

Yes Jeremy

I have tried ..

java.sql.SQLException: ORA-00932: inconsistent datatypes: expected NUMBER got -

Thanks

Ajay

Former Member
0 Kudos

Ajay,

this sample select statement works on Oracle 9.2.x.

SELECT 
          t.YOURXMLCOLUMN.extract('*').getStringVal() as myXMLColumn
FROM
          TABLENAME t

Let us know the result.

BR

Pedro Iglesias

former_member192939
Active Participant
0 Kudos

Wow ..

Thank you for the tip Pedro .. Aliasing the table name worked

I was trying ..

SELECT

TABLENAME.YOURXMLCOLUMN.extract('*').getStringVal() as myXMLColumn

FROM

TABLENAME

Got the following error.

Error is java.sql.SQLException: ORA-00904: "TABLENAME"."YOURXMLCOLUMN"."EXTRACT": invalid identifier ..

Tip: Alias table name in the query.

Thank you

Ajay.

Answers (0)