|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
help needed for inserting data in DB2 |
« View previous topic :: View next topic » |
Author |
Message
|
kishoreMuthyala |
Posted: Tue Mar 30, 2004 11:49 pm Post subject: help needed for inserting data in DB2 |
|
|
Apprentice
Joined: 24 Mar 2004 Posts: 35 Location: singapore
|
Hi,
I have created a message flow with MQInput node,Compute Node,
MQOutputnode.
I have created a database in DB2 and 2 fields.
I have created a DSN name for it and tested it.
In Compute node i have written the statement to Insert and in Properties i have given the DataSource name .
When iam trying to send some data from Inputnode it is going to OutputQ.
And not going into the DB2.It is also not showing any errors.
this is the code which i have written
CREATE COMPUTE MODULE dbmsgfl1_Compute
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
DECLARE A INTEGER;
Declare sstat character;
Declare serr character;
Declare scode Integer;
Declare snative Integer;
SET OutputRoot = InputRoot;
WHILE A <= CARDINALITY(InputRoot.XML.sap_bapi_companycode_getlist.sap_companycode_list[])
DO
INSERT INTO Database.MQSIUID.SAP_BAPI_COMPANYCODE_GETLIST(COMPANY_CODE,NAME_OF_THE_COMPANY)
VALUES(InputRoot.XML.sap_bapi_companycode_getlist.sap_companycode_list[A].Company_Code ,
InputRoot.XML.sap_bapi_companycode_getlist.sap_companycode_list[A].Name_of_the_company_code_or_company);
SET A=A+1;
END WHILE;
Set scode = SQLCODE;
if scode <> 0 then
set sstat = SQLSTATE;
set serr = SQLERRORTEXT;
set snative = SQLNATIVEERROR;
THROW USER EXCEPTION MESSAGE 2950 VALUES
('sql state',sstat,scode,serr,snative );
end if;
RETURN TRUE;
END;
END MODULE;
best regards & thanks for the support
Kishore Muthyala |
|
Back to top |
|
 |
scaryjase |
Posted: Wed Mar 31, 2004 6:37 am Post subject: |
|
|
Novice
Joined: 17 Jul 2003 Posts: 22
|
is it actually doing the INSERTs? try using the debugger (if V5) or trace files to find out what's going on... _________________ scary |
|
Back to top |
|
 |
JT |
Posted: Wed Mar 31, 2004 6:58 am Post subject: |
|
|
Padawan
Joined: 27 Mar 2003 Posts: 1564 Location: Hartford, CT.
|
You didn't declare a default value for "A", so when "A" (NULL value) is compared to the cardinality value it results in an "unknown" condition and the logic within the while loop is not executed. |
|
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
|
|
|
|