Author |
Message
|
CHAN |
Posted: Tue Mar 01, 2011 7:53 pm Post subject: reterieving data from Oracle database |
|
|
Novice
Joined: 22 Mar 2010 Posts: 12
|
HI,
I have a sample flow
MQInput---->Compute node --> MQOutputNode
MQ version: 6.0
MB version; 6.0.0.9
Oracle : 11g
I am selecting soap messages stored in database column(data type LONG) and assigning it to output root.All i have to do is whatever soap messages i get in the result set ,i need to propagate it output root one by one to do some transformation before making SOAP call.
Code used in Compute Node:
declare resultset row;
delcare I integer 1;
SET Outputroot.MQMD.structid =MQMD_STRUC_ID;
SET OutputRoot.MQM.Msgtype = MQMD_DATAGRAM;
SET OutputRoot.MQM.Codedd = 1208;
SET Outputroot.properties.DOMAIN = 'XMLNSC';
## data type of MESSAGE_CONTENT column is LONG in ORACLE 11g database.
SET Environment.Resultset.Rows[] = (SELECT w.MESSAGE_CONTENT FROM database.ialooging.TABLE AS w WHERE w.STATUS = 'P');
FOR row1 AS ENVIRONMENT.Resultset.Rows[]
SET OutputRoot.XMLNSC = CAST(row1.MESSAGE_CONTENT AS CHAR CCSID 1208);
DECLARE REF to OutputRoot.XMLNSC.Resultset.Rows[];
SET REF.MESSAGE_CONTENT = CAST(row1.MESSAGE_CONTENT AS CHAR CCSID 1208);
SET OutputRoot = InputRoot;
SET outputRoot.XMLNSC = NULL;
Propagate;
I = I+1;
END FOR;
RESULT FALSE;
This is in compute node,
i get the output with "...." between fields in the message.I am not getting exact message that is in database.something like this.
<field1>...</field1>......
<field2>...</field2>....
<filedn>...</fieldn>....
Even i tried with CAST AS BLOB and used RCD node but i get error like (inavlid document type) invalid message body
things to know:
1. Am i using the for loop through array exactly to extract fields(soap messages) from result set and assigning it to output root one by one.If not,correct me.
2. What type of casting do i have to use to retrive data type of LONG exactly same as that in database as my code is assinging "...." to output.
I have been trying this since a while.Its an important and needs to be completed early.Please let me know the best way of doing it.Thanks for your help. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Mar 01, 2011 9:13 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Why is the database splitting up the SOAP message and not storing it as a CLOB?
Why are you parsing it row by row and not as one?
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Mar 02, 2011 2:36 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
CAST does not perform a PARSE. |
|
Back to top |
|
 |
CHAN |
Posted: Wed Mar 02, 2011 6:32 am Post subject: |
|
|
Novice
Joined: 22 Mar 2010 Posts: 12
|
database is storing correctly only but in the flow i get the response message with "...." between fields.Example:
<"xml version="1.0"?>.<bfg-env:Envelope xmlns="http://www.XXXX....">..<bfg-env:Header>...<bfg-hdr:MessageHeader>....<bfg-hdr:Service>.....<bfg-hdr:ServiceName>......</bfg-hdr:ServiceName>.....<bfgcfg-hdr:MessageType>Response</bfg-hdr:MessageType>....</bfg-hdr:Service>....<bfg-hdr:From>.....<bfg-hdr:PartyId>11-22-3333</bfg-
I am trying to get the actual copy that is being stored in Database.
I am not trying to parse using CAST. As data type is of LONG, i am using CAST to convert it into char.What is the correct way to get it done? |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Mar 02, 2011 7:10 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
CHAN wrote: |
I am trying to get the actual copy that is being stored in Database.
I am not trying to parse using CAST. As data type is of LONG, i am using CAST to convert it into char.What is the correct way to get it done? |
Code: |
SET OutputRoot.XMLNSC = CAST(row1.MESSAGE_CONTENT AS CHAR CCSID 1208); |
That doesn't do what you think it does. |
|
Back to top |
|
 |
CHAN |
Posted: Wed Mar 02, 2011 9:13 am Post subject: |
|
|
Novice
Joined: 22 Mar 2010 Posts: 12
|
Can u please suggest the way to get it done.Thanks in advance |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Mar 02, 2011 9:32 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
I suggest you search for PARSE. |
|
Back to top |
|
 |
|