ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » database record to XML

Post new topic  Reply to topic
 database record to XML « View previous topic :: View next topic » 
Author Message
rkford11
PostPosted: Tue Nov 16, 2004 10:08 am    Post subject: database record to XML Reply with quote

Partisan

Joined: 06 Jun 2004
Posts: 316

I retrieve a record from the database table and place it on to the queue.Now how do i build XML using this data. Please let me know
how do i build up my message flow.

Thanks
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Nov 16, 2004 10:26 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

You will either build a message model that contains the structure of your XML message...

Or you will use SET to create new output fields and assign them to the values of the input fields.

Please read ANY of the documentation and look at ANY of the samples.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Nov 16, 2004 10:28 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

What is the format of your data on the queue XML? What is your XML format? Can you give us an example?
In a compute node you can produce XML output from SELECT statement, for example,
Code:

SET OutputRoot.XML.Myoutput.ResultSet[] = ( SELECT t.* from Database.mytable as t)

_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
hiram0548
PostPosted: Tue Nov 16, 2004 10:28 am    Post subject: build XML using database data Reply with quote

Newbie

Joined: 16 Nov 2004
Posts: 2

What format is the data that is coming into the flow? (fixed, csv, etc)
Back to top
View user's profile Send private message
rkford11
PostPosted: Tue Nov 16, 2004 10:50 am    Post subject: Re: build XML using database data Reply with quote

Partisan

Joined: 06 Jun 2004
Posts: 316

hiram0548 wrote:
What format is the data that is coming into the flow? (fixed, csv, etc)


I have two columns in the database, and using trigger functions i send a record to the input queue.format of record in the queue
54 ABC
now how do i convert this record into an XML record.

Thanks
Back to top
View user's profile Send private message
hiram0548
PostPosted: Tue Nov 16, 2004 11:00 am    Post subject: Re: build XML using database data Reply with quote

Newbie

Joined: 16 Nov 2004
Posts: 2

So you are grabbing to fields from a database; one numeric and one alpha? How many characters is each field in the database schema?


rkford11 wrote:
hiram0548 wrote:
What format is the data that is coming into the flow? (fixed, csv, etc)


I have two columns in the database, and using trigger functions i send a record to the input queue.format of record in the queue
54 ABC
now how do i convert this record into an XML record.

Thanks
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Nov 16, 2004 11:10 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Model your input message using CWF or TDS wire format. Use a compute node to convert your input message to XML format.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
rkford11
PostPosted: Tue Nov 16, 2004 11:22 am    Post subject: Reply with quote

Partisan

Joined: 06 Jun 2004
Posts: 316

kirani wrote:
Model your input message using CWF or TDS wire format. Use a compute node to convert your input message to XML format.


Thanks Kiran, But I haven't worked with CWF or TDS much so can u please guide me in modelling the i/p msg to these formats.

Thanks
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Nov 16, 2004 11:24 am    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Please provide your WMQI version details and field length (and type) for each element in your input message. Also, please post sample XML output message.
_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
rkford11
PostPosted: Tue Nov 16, 2004 11:35 am    Post subject: Reply with quote

Partisan

Joined: 06 Jun 2004
Posts: 316

kirani wrote:
Please provide your WMQI version details and field length (and type) for each element in your input message. Also, please post sample XML output message.


I am working with WBIMB 5.0 and msg length and type
empno numeric(10)
empname varchar(20)
sample o/p XML would be something like this
<empno>44</empno>
<empname>ABC</empname>

Thanks
Back to top
View user's profile Send private message
kirani
PostPosted: Tue Nov 16, 2004 12:11 pm    Post subject: Reply with quote

Jedi Knight

Joined: 05 Sep 2001
Posts: 3779
Location: Torrance, CA, USA

Since your message is fixed length, you can model your message using CWF format. Define two elements as follows,
1) empno -> numeric, length 10.
2) empname -> string, length 20.

You can refer to any one of the redbook (link on the top of this forum), which will explain creation of message set at very detailed level.

Once you define your CWF message you can parse your input message using this format.

In a compute node you can then transform your input message to XML format using ESQL. For example,
Code:

SET OutputRoot.XML.MyOutput.empno = InputRoot.MRM.empno;
SET OutputRoot.XML.MyOutput.empname = InputRoot.MRM.empname;

_________________
Kiran


IBM Cert. Solution Designer & System Administrator - WBIMB V5
IBM Cert. Solutions Expert - WMQI
IBM Cert. Specialist - WMQI, MQSeries
IBM Cert. Developer - MQSeries

Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » database record to XML
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.