Author |
Message
|
ravi_ishere |
Posted: Mon Jan 28, 2008 6:04 am Post subject: Converting the CLOB Getting from OracleDB to XML in WBIMB |
|
|
Apprentice
Joined: 20 Jan 2008 Posts: 29
|
Hi,
Can any one assist on converting the clob returning from stored procedure to xml in ESQL.
Details:
I am returning the CLOB contains the XML elements from OUT. Wheni am attaching it to input xml it is considering it as CHARACTER. How can we convert that CLOB to XML elements using ESQL.
Thanks,
R |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jan 28, 2008 7:40 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
You need to read about CREATE FIELD. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ravi_ishere |
Posted: Mon Jan 28, 2008 8:52 am Post subject: |
|
|
Apprentice
Joined: 20 Jan 2008 Posts: 29
|
sorry i did'nt understood. Can you explain briefly. |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jan 28, 2008 9:22 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Yes.
You need to go read stuff.
The stuff you need to go read is the documentation.
The documentation you need to go read is the documentation about the ESQL statement "CREATE FIELD". _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ravi_ishere |
Posted: Mon Jan 28, 2008 9:44 am Post subject: |
|
|
Apprentice
Joined: 20 Jan 2008 Posts: 29
|
As per the docs we need to create element by element but not reading as a whole xml from CLOB.
CALL mySP(IN var CHAR, OUT var1 CHARACTER)
this is the stored procedure call and the var1 is CLOB in database. Is it notb possible it as whole xml by looping element by element.
Thanks,
R |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon Jan 28, 2008 10:04 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I really don't understand what you're saying.
You can use the CREATE FIELD statement to turn (by a process called 'parsing') a CHARACTER field that represents an XML document into a logical message tree that represents the XML document.
You can't pass a logical message tree using Character fields. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ravi_ishere |
Posted: Mon Jan 28, 2008 5:20 pm Post subject: |
|
|
Apprentice
Joined: 20 Jan 2008 Posts: 29
|
i.e casting the CLOB getting from DB as CHARACTER to XML tree structure in Message Broker. |
|
Back to top |
|
 |
fjb_saper |
Posted: Mon Jan 28, 2008 6:02 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
There is no casting for what you are trying to do.
Lookup CREATE FIELD PARSE in the documentation already!  _________________ MQ & Broker admin |
|
Back to top |
|
 |
ravi_ishere |
Posted: Mon Jan 28, 2008 10:12 pm Post subject: |
|
|
Apprentice
Joined: 20 Jan 2008 Posts: 29
|
Sorry for the making confusion and thanks alot for helping. excuse me for asking it again.
OUT12 is declared as CHARACTER which is a returned as CHARACTER from DB(in DB it is CLOB)
DECLARE inBitstream BLOB ASBITSTREAM(OUT12, inEncoding, inCCSID);
CREATE FIELD OutputRoot.XMLNS.TestCase.Root DOMAIN('XMLNSC') PARSE(inBitstream , InputProperties.Encoding, InputProperties.CodedCharSetId);
can anyone validate these statements. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jan 29, 2008 1:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
So you cast your character to a BLOB! Do you know what CCSID it is in? _________________ MQ & Broker admin |
|
Back to top |
|
 |
kimbert |
Posted: Tue Jan 29, 2008 2:11 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
CREATE FIELD OutputRoot.XMLNS.TestCase.Root DOMAIN('XMLNSC') PARSE(inBitstream , InputProperties.Encoding, InputProperties.CodedCharSetId); |
You cannot use DOMAIN('XMLNSC') to create OutputRoot.XMLNS.
Everything you have been told so far is available by pressing the Search button and spending some time ( your time ) |
|
Back to top |
|
 |
ravi_ishere |
Posted: Wed Jan 30, 2008 1:29 am Post subject: |
|
|
Apprentice
Joined: 20 Jan 2008 Posts: 29
|
Hi,
Thanks for all for help i am able to convert to xml and added the same to message tree.
Here is the code working for me
Still i have one more query that Is the XML will recognize as XMLNSC message?
DECLARE blobMSG BLOB;
CALL HEADERS ('TEST',blobMSG,ERROR1,ERROR2 );
SET Environment.Variables.TEST12 = blobMSG;
DECLARE inCCSID INT InputProperties.CodedCharSetId;
DECLARE inEncoding INT InputProperties.Encoding;
DECLARE creationPtr REFERENCE TO Environment.Variables.TestCase.Root;
CREATE FIELD creationPtr IDENTITY (XML.ParserRoot)Root;
CREATE LASTCHILD OF creationPtr DOMAIN('XML') PARSE(blobMSG, inEncoding,inCCSID);
SET OutputRoot.XMLNSC.mySoapNS:Envelope.mySoapNS:Header."TestHeader" = Environment.XML."soapenv:TestHeader"; |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 30, 2008 2:45 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
ravi_ishere wrote: |
Still i have one more query that Is the XML will recognize as XMLNSC message?
|
There's no such thing as an XMLNSC messages; only an XML message parsed into the XMLNSC domain. The difference between XMLNS & XMLNSC is documented, as are the reasons you shouldn't use the XML domain in WMBv6. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
ravi_ishere |
Posted: Wed Jan 30, 2008 3:15 am Post subject: |
|
|
Apprentice
Joined: 20 Jan 2008 Posts: 29
|
Yes i got it thanks. how can we make the XML message tree to recognize as XMLNSC |
|
Back to top |
|
 |
Vitor |
Posted: Wed Jan 30, 2008 3:37 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
ravi_ishere wrote: |
Yes i got it thanks. how can we make the XML message tree to recognize as XMLNSC |
I suspect we have a language mismatch here. Your question doesn't make sense as asked, and if you're asking what I think you're asking then you've got the answer. Especially if you have, as you say, "got it". _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
|