Author |
Message
|
rkford11 |
Posted: Tue Nov 16, 2004 10:08 am Post subject: database record to XML |
|
|
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 |
|
 |
jefflowrey |
Posted: Tue Nov 16, 2004 10:26 am Post subject: |
|
|
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 |
|
 |
kirani |
Posted: Tue Nov 16, 2004 10:28 am Post subject: |
|
|
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 |
|
 |
hiram0548 |
Posted: Tue Nov 16, 2004 10:28 am Post subject: build XML using database data |
|
|
Newbie
Joined: 16 Nov 2004 Posts: 2
|
What format is the data that is coming into the flow? (fixed, csv, etc) |
|
Back to top |
|
 |
rkford11 |
Posted: Tue Nov 16, 2004 10:50 am Post subject: Re: build XML using database data |
|
|
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 |
|
 |
hiram0548 |
Posted: Tue Nov 16, 2004 11:00 am Post subject: Re: build XML using database data |
|
|
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 |
|
 |
kirani |
Posted: Tue Nov 16, 2004 11:10 am Post subject: |
|
|
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 |
|
 |
rkford11 |
Posted: Tue Nov 16, 2004 11:22 am Post subject: |
|
|
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 |
|
 |
kirani |
Posted: Tue Nov 16, 2004 11:24 am Post subject: |
|
|
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 |
|
 |
rkford11 |
Posted: Tue Nov 16, 2004 11:35 am Post subject: |
|
|
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 |
|
 |
kirani |
Posted: Tue Nov 16, 2004 12:11 pm Post subject: |
|
|
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 |
|
 |
|