Inserting or Updating Xml data into Oracle table

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
sabeenapeter
Premium Member
Premium Member
Posts: 2
Joined: Tue Mar 17, 2015 9:54 pm

Inserting or Updating Xml data into Oracle table

Post by sabeenapeter »

Hi,
Im trying to read XML data from Oracle XMLType column and insert into another Oracle table column of XMLType using ODBC Connector stage in datastage 8.1.

During insert the below error is thrown:-
ODBC_Connector: ODBC function "SQLFetch" reported: SQLSTATE = HYC00: Native Error Code = 0: Msg = [IBM(DataDirect OEM)][ODBC Oracle driver]Driver does not support selecting a column of type XMLType. You must cast columns of type XMLType to a CLOB by using the cast function.

How to overcome this error?

Query used to read data :-
select x.REPORT_XML.getclobval() as REPORT_XML,CR_RPT_NUM ,PAGE_IND from temp x;

Insert Statement in ODBC Connector:-

INSERT INTO temp1(REPORT_XML,CR_RPT_NUM,PAGE_IND) VALUES(sys.xmltype.createxml(ORCHESTRATE.REPORT_XML),ORCHESTRATE.CR_RPT_NUM,ORCHESTRATE.PAGE_IND)
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

I thought the Connectors were updated to handle the XML Type, but you are on 8.1, which is really old.

Anyone else tried it in a newer release?

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Just an idea, since you're on a very old version: can you handle the XML as a VarChar (or Long VarChar) data type within your job design? Ignore (or demote) any metadata mismatch alerts.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
sabeenapeter
Premium Member
Premium Member
Posts: 2
Joined: Tue Mar 17, 2015 9:54 pm

Post by sabeenapeter »

Thanks for the responses.

When I tried to insert as CLOB the below error is given
ODBC_Connector_15,2: ODBC function "SQLFetch" reported: SQLSTATE = HYC00: Native Error Code = 0: Msg = [IBM(DataDirect OEM)][ODBC Oracle driver]Driver does not support selecting a column of type XMLType. You must cast columns of type XMLType to a CLOB by using the cast function. (CC_OdbcInputStream::open, file CC_OdbcInputStream.cpp, line 173)

Below is the insert statement and REPORT_XML is a CLOB in target table
Insert into temp2(CR_RPT_NUM,PAGE_IND,REPORT_XML) values (orchestrate.CRNUM,orchestrate.PAGE_IND,orchestrate.REPORT_XML);
amit.jaiswal_ATL
Premium Member
Premium Member
Posts: 28
Joined: Thu Oct 23, 2014 1:49 pm

Post by amit.jaiswal_ATL »

We have XML_VALUE column as BLOB in Oracle Table and we are using LongVarBinary data type for this column in DataStage which is working fine. You may want to try this option. FYI, we are using Oracle Connector Stage in DS 9.1 and 11.3.
Amit Jaiswal
Atlanta GA USA
Post Reply