Convert DB record to XML format.

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
gxhpainter
Premium Member
Premium Member
Posts: 28
Joined: Tue Jul 01, 2008 9:23 am

Convert DB record to XML format.

Post by gxhpainter »

Hi,

Want to read the DB table single record , convert into XML format layout and post the record in MQ Queue in one job.

Layout in the MQ Queue payload should look like below.
<emp>
<body>'john'
</body>
</emp>

How can I do it?
What are the stages the best used for the above?

Rgds,
Chakra
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

You have some reading and searching to do...in this forum and in the documentation. Your format is fairly straightforward. Be sure to read about the single row and trigger functions of the XMLOutput Stage, and to unit test things before putting it all together. The MQ stages as a target are as much of a learning curve as is XMLOutput. Get things working to a sequential file before you try to do all of it. See also if you have a sample of the xml or an xsd so that you can import the metadata.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
gxhpainter
Premium Member
Premium Member
Posts: 28
Joined: Tue Jul 01, 2008 9:23 am

Post by gxhpainter »

To Achieve the converstion.

1. Use ODBC Stage / DB Stge -> Transformation stage -> XML Input -> MQ Stage plugin
2. In XML Output stage, use '/' in the description.
3. Use Single row output.

We can send the message with XML format as payload in MQ Queue and structure will be retained in the payload.

Rgds,
Chakradhar.
Post Reply