ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » help needed for inserting data in DB2

Post new topic  Reply to topic
 help needed for inserting data in DB2 « View previous topic :: View next topic » 
Author Message
kishoreMuthyala
PostPosted: Tue Mar 30, 2004 11:49 pm    Post subject: help needed for inserting data in DB2 Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
scaryjase
PostPosted: Wed Mar 31, 2004 6:37 am    Post subject: Reply with quote

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
View user's profile Send private message MSN Messenger
JT
PostPosted: Wed Mar 31, 2004 6:58 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » help needed for inserting data in DB2
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.