|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Step through ExceptionList? |
« View previous topic :: View next topic » |
Author |
Message
|
ronq |
Posted: Thu Apr 03, 2003 2:06 am Post subject: Step through ExceptionList? |
|
|
Newbie
Joined: 03 Apr 2003 Posts: 8
|
Hi all,
i want to step through the ExceptionList-Tree in my ErrorHandling compute-node connected on the catch-terminal of Input-Node.
The code below is from this post (thanks to J.)
http://www.mqseries.net/phpBB/viewtopic.php?t=5565&highlight=exceptionlist
Code: |
DECLARE ErrorNum INTEGER;
DECLARE ErrText CHARACTER;
DECLARE Path CHARACTER;
SET Path = 'InputExceptionList.*[1]';
WHILE EVAL('FIELDNAME('|| Path || ') IS NOT NULL') DO
IF EVAL('FIELDNAME(' || Path || '.Number) IS NOT NULL') THEN
SET ErrorNum = Eval(Path ||'.Number');
If ErrorNum > 3000 AND ErrorNum < 3020 THEN
SET ErrText = EVAL(Path ||'.Insert[1].Text');
ELSE
SET ErrText = EVAL(PATH ||'.Text');
END IF;
END IF;
SET Path = Path ||'.*[LAST]');
END WHILE;
|
The Code works fine, but I want step through all fields in the ExceptionList. Therefore I produced an error in my compute-node (Select-Statement). The ExceptionList looks like this:
(0x1000000)RecoverableException = (
(0x3000000)File = '/build/S210_P/src/DataFlowEngine/ImbComputeNode.cpp'
(0x3000000)Line = 453
(0x3000000)Function = 'ImbComputeNode::evaluate'
(0x3000000)Type = 'ComIbmComputeNode'
(0x3000000)Name = '02a49c62-f100-0000-0080-e73c96192db0'
(0x3000000)Label = 'F_ALL_SIMC.CP_PTM_SIMC_SelectData'
(0x3000000)Text = 'Caught exception and rethrowing'
(0x3000000)Catalog = 'WMQIv210'
(0x3000000)Severity = 3
(0x3000000)Number = 2230
(0x1000000)RecoverableException = (
(0x3000000)File = '/build/S210_P/src/DataFlowEngine/ImbRdl/ImbRdlExternalDb.cpp'
(0x3000000)Line = 161
(0x3000000)Function = 'SqlExternalDbStmt::executeStmt'
(0x3000000)Type = 'ComIbmComputeNode'
(0x3000000)Name = '02a49c62-f100-0000-0080-e73c96192db0'
(0x3000000)Label = 'F_ALL_SIMC.CP_PTM_SIMC_SelectData'
(0x3000000)Text = 'The following error occurred during execution of an SQL statement'
(0x3000000)Catalog = 'WMQIv210'
(0x3000000)Severity = 3
(0x3000000)Number = 2519
(0x1000000)Insert = (
(0x3000000)Type = 2
(0x3000000)Text = '5'
)
(0x1000000)Insert = (
(0x3000000)Type = 2
(0x3000000)Text = '5'
)
(0x1000000)Insert = (
(0x3000000)Type = 5
(0x3000000)Text = 'sitadbdv'
)
(0x1000000)Insert = (
(0x3000000)Type = 5
(0x3000000)Text = 'SELECT p cpy_msg_timestamp AS MSG_TIMESTAMP
FROM SITA.T_SITA_CPY_MSG
WHERE cpy_msg_id = ?'
)
(0x1000000)Insert = (
(0x3000000)Type = 5
(0x3000000)Text = '429, '
)
(0x1000000)DatabaseException = (
(0x3000000)File = '/build/S210_P/src/DataFlowEngine/ImbOdbc.cpp'
(0x3000000)Line = 152
(0x3000000)Function = 'ImbOdbcHandle::checkRcInner'
(0x3000000)Type = ''
(0x3000000)Name = ''
(0x3000000)Label = ''
(0x3000000)Text = 'Root SQL exception'
(0x3000000)Catalog = 'WMQIv210'
(0x3000000)Severity = 3
(0x3000000)Number = 2321
(0x1000000)Insert = (
(0x3000000)Type = 2
(0x3000000)Text = '-1'
)
(0x1000000)DatabaseException = (
(0x3000000)File = '/build/S210_P/src/DataFlowEngine/ImbOdbc.cpp'
(0x3000000)Line = 252
(0x3000000)Function = 'ImbOdbcHandle::checkRcInner'
(0x3000000)Type = ''
(0x3000000)Name = ''
(0x3000000)Label = ''
(0x3000000)Text = 'Child SQL exception'
(0x3000000)Catalog = 'WMQIv210'
(0x3000000)Severity = 3
(0x3000000)Number = 2322
(0x1000000)Insert = (
(0x3000000)Type = 5
(0x3000000)Text = '42000'
)
(0x1000000)Insert = (
(0x3000000)Type = 2
(0x3000000)Text = '923'
)
(0x1000000)Insert = (
(0x3000000)Type = 5
(0x3000000)Text = '[MERANT][ODBC Oracle 8 driver][Oracle 8]ORA-00923: FROM keyword not found where expected
Interesting are alle Number-, Text-, Label- and Insert.Text -fields. Is there a simple way to step through all these fields in ExceptionList to concatenate to a string putting to a output message or to file referenced in the trace-node (after the compute-node)? (And can I use this in trace-node?)
Thanks a lot for your help. _________________ RonQ |
|
Back to top |
|
 |
ronq |
Posted: Thu Apr 03, 2003 5:28 am Post subject: Step through the ExceptionList |
|
|
Newbie
Joined: 03 Apr 2003 Posts: 8
|
I have to just modify the sample-code (see above, from J.).
Every last field references to the next sub-tree(s) of ExceptionList. In that sub-tree there are the fields number, text, (label) or insert[].text
The Code looks now like this:
Code: |
DECLARE i INTEGER;
DECLARE c CHARACTER;
DECLARE ErrorNum INTEGER;
DECLARE ErrNum CHARACTER;
DECLARE ErrText CHARACTER;
DECLARE InsertErrText CHARACTER;
DECLARE ErrLabel CHARACTER;
DECLARE Path CHARACTER;
DECLARE cr_blob BLOB;
DECLARE lf_blob BLOB;
DECLARE crlf_blob BLOB;
DECLARE tab_blob BLOB;
DECLARE text_blob BLOB;
SET cr_blob = X'0D';
SET lf_blob = X'0A';
SET crlf_blob = cr_blob || lf_blob;
SET tab_blob = X'09';
SET Environment.Variables = NULL;
SET Environment.Variables.ErrorText = '';
SET Path = 'InputExceptionList.*[1]';
WHILE EVAL('FIELDNAME('|| Path || ') IS NOT NULL') DO
SET InsertErrText = '';
IF EVAL('FIELDNAME(' || Path || '.Number) IS NOT NULL') THEN
SET ErrorNum = Eval(Path ||'.Number');
SET ErrNum = CAST( ErrorNum AS CHARACTER);
SET ErrLabel = EVAL(Path ||'.Label');
SET ErrText = EVAL(Path ||'.Text');
IF ErrLabel IS NULL THEN
SET ErrLabel = '';
END IF;
IF ErrText IS NULL THEN
SET ErrText = '';
END IF;
IF ErrNum IS NULL THEN
SET ErrNum = '';
END IF;
IF EVAL('FIELDNAME('|| Path || '.Insert) IS NOT NULL') THEN
SET i = 1;
SET c = CAST(i as CHARACTER);
WHILE EVAL('FIELDNAME('|| Path || '.Insert[' || c || '].Text) IS NOT NULL') DO
SET InsertErrText = InsertErrText ||
EVAL(Path || '.Insert[' || c || '].Text') || ' - ';
SET i = i + 1;
SET c = CAST(i as CHARACTER);
END WHILE;
END IF;
SET text_blob = CAST((ErrNum || ': ' || ErrLabel) AS BLOB CCSID "InputRoot"."MQMD"."CodedCharSetId" ENCODING "InputRoot"."MQMD"."Encoding");
SET text_blob = text_blob || crlf_blob ||tab_blob;
SET text_blob = text_blob || CAST(ErrText AS BLOB CCSID "InputRoot"."MQMD"."CodedCharSetId" ENCODING "InputRoot"."MQMD"."Encoding") || crlf_blob || tab_blob || tab_blob;
SET text_blob = text_blob || CAST(InsertErrText AS BLOB CCSID "InputRoot"."MQMD"."CodedCharSetId" ENCODING "InputRoot"."MQMD"."Encoding") || crlf_blob || crlf_blob;
SET Environment.Variables.ErrorText = Environment.Variables.ErrorText || CAST(text_blob AS CHARACTER CCSID "InputRoot"."MQMD"."CodedCharSetId" ENCODING "InputRoot"."MQMD"."Encoding");
END IF;
SET Path = Path || '.*[LAST]';
END WHILE;
|
Put the result "Environment.Variables.ErrorText" to a file in a trace-node after the compute-node. _________________ RonQ |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|