Writing XML strings to Database

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
nsm
Premium Member
Premium Member
Posts: 139
Joined: Mon Feb 09, 2004 8:58 am

Writing XML strings to Database

Post by nsm »

Hi,

My database guys wanted to write data into an XML string in the database.
For ex:

Key from Source will stay as Key in the target but all other attributes go as an XML String.

I think its doable but wanted to get opinions if anybody faced issues with it and what do I use : XML Transformer and XML Output stage?

Thanks
nsm.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Just XML Output, I would think. What database? What is the target field's datatype?
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Oracle even has that datatype. One caveat is that if you want more than 2Kb of XML then you will have to use a CLOB or BLOB in Oracle or comparable datatypes in other databases.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Exactly, and all of which are officially "unsupported". :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Yep, unsupported. We have a couple of jobs here that send over 40 VarChar2 columns containing XML (and SOAP) to Oracle, where they are combined into one BLOB for compression and storage. The same happens on the way back into DataStage and the whole thing is a complex and unwieldy system - I wish we could have used Server jobs and Hashed files for storage for this portion.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

All important considerations. Here's how you can do it if you choose a supported datatype.....

If the strings are short enough to use a supported datatype, like char or longvarchar, just have a single column on the output link of your XMLOutput Stage.... call it anything, like "myXMLoutput" ...give it a longvarchar and some length, such as 99999, and then put a single slash in the Description property. All of your xml will go into that column as a single string.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
Post Reply