Author |
Message
|
ydsk |
Posted: Tue Aug 15, 2006 12:13 pm Post subject: need sample ESQL to convert ExceptionList tree into Char str |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
Can someone please post some sample ESQL code that converts the entire ExceptionList structure into a CHAR string.
I want to dump the entire ExceptionList as a single field into a database column.
Thanks in advance.
ydsk. |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Aug 15, 2006 12:34 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
The search button is your friend.
Try searching for "esql ExceptionList". _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ydsk |
Posted: Tue Aug 15, 2006 1:12 pm Post subject: |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
Jeff,
I am using the following declaration in a database node connected to the Catch terminal of Input node:
DECLARE FULLEXCEPTION CHARACTER CAST(ExceptionList AS CHAR CCSID Root.MQMD.CodedCharSetId);
But it's returning NULL as the value of FULLEXCEPTION.
I am not sure where the mistake is.
Thanks. |
|
Back to top |
|
 |
madi |
Posted: Tue Aug 15, 2006 1:14 pm Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
i dont know why but im sure it wont work like that !!
did you search the forum for examples??
--madi |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Aug 15, 2006 1:15 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
I clicked on the button labeled "Search" on the top right of this page, and I put in "esql ExceptionList" into the query string, and I told it to search this particular forum.
And I found a direct answer to your first question - that would also explain why your code you posted didn't work - within the first ten hits. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
ydsk |
Posted: Tue Aug 15, 2006 1:16 pm Post subject: |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
I saw the user trace of my flow.
The CCSID was getting evaluated to 437 properly but ExceptionList inside the CAST statement was getting evaluated as NULL initially and that's the whole problem.
I searched this forum but couldn't find an answer.
It should be simple to do but looks like I am missing something here.
Thanks. |
|
Back to top |
|
 |
madi |
Posted: Tue Aug 15, 2006 1:20 pm Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
i think u need to use bitstream or asbitstream
--madi |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Aug 15, 2006 1:24 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
|
Back to top |
|
 |
madi |
Posted: Tue Aug 15, 2006 1:29 pm Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
well that was my post initially
i ended up getting rid of all the EVALs in my code right now
ydsk:
did you look up anything about asbitstream??
--madi |
|
Back to top |
|
 |
ydsk |
Posted: Tue Aug 15, 2006 1:48 pm Post subject: |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
yes, I tried the code in my database node:
DECLARE EXCEPTIONBLOB BLOB ASBITSTREAM(ExceptionList);
DECLARE FULLEXCEPTION CHAR CAST(EXCEPTIONBLOB AS CHAR CCSID Root.MQMD.CodedCharSetId);
But the first declare statement is returning an ' 'X' ' . It's an X followed by nothing. X is for hexadecimal.
Anything wrong here ? |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Aug 15, 2006 1:53 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
ExceptionList doesn't have a parser associated with it, I think.
You may not be able to use ASBITSTREAM on it. You may have to build the string yourself by concatenating the field name and value. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
madi |
Posted: Tue Aug 15, 2006 1:55 pm Post subject: |
|
|
 Chevalier
Joined: 17 Jan 2006 Posts: 475
|
try this
Code: |
CAST(ASBITSTREAM(ExceptionList OPTIONS FolderBitStream) AS CHARACTER
CCSID InputRoot.Properties.CodedCharSetId ENCODING InputRoot.Properties.Encoding) |
hope it works .... it works for me, i use to write the whole input XML as char!!
--madi |
|
Back to top |
|
 |
ydsk |
Posted: Tue Aug 15, 2006 2:48 pm Post subject: |
|
|
Chevalier
Joined: 23 May 2005 Posts: 410
|
Madi, I tried your code but it didn't work for ExceptionList.
I think what Jeff said is true. There is NO parser associated with ExceptionList. It's similar to Environment and LocalEnvironment.
I tried the following code :
Create LASTCHILD of Environment.XML DOMAIN('XML') Name 'ExceptionList' Value ExceptionList;
DECLARE options INTEGER BITOR(FolderBitStream, ValidateContent, ValidateValue);
DECLARE EXCEPTIONBLOB BLOB ASBITSTREAM(Environment.XML.ExceptionList OPTIONS options CCSID Root.MQMD.CodedCharSetId);
DECLARE FULLEXCEPTION CHAR CAST(EXCEPTIONBLOB AS CHAR);
But when the field FULLEXCEPTION is inserted into a database column I see the value X'3c457863657074696f6e4c6973743e3c2f457863657074696f6e4c6973743e'.
How can I get chracter data in the database table and NOT the hexadecimal data like above.
Any ideas ??
Thanks. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Aug 15, 2006 6:41 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Once you have cast your tree as bitstream you have a BLOB.
Now CAST the BLOB as CHAR and move this to the DB.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
jefflowrey |
Posted: Wed Aug 16, 2006 1:51 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
More specifically, move or copy the CCSID options on the CAST (as blob) to the CAST(as char).
 _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
|