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 » In parameters have been received in worng order in Database

Post new topic  Reply to topic
 In parameters have been received in worng order in Database « View previous topic :: View next topic » 
Author Message
raj_i2u
PostPosted: Fri Aug 20, 2010 1:47 am    Post subject: In parameters have been received in worng order in Database Reply with quote

Novice

Joined: 05 Apr 2010
Posts: 15

Hi,

I have esql which passes the IN parameters by the stored proc to the Oracle data base to update the database table the problem is the order of the In parameters are receving in wrong order by the Oracle, though the WMB is passing it in correct order,

we have been passing value1 and value 2 to the column1 and column2 in oracle where both shd be not null.

The strange thing is on database side we were receiving value2 to the column1 and "NULL" to the column2.

the database the throwing the NUll exception

If anybody can throw light on this would be highly appreciable

Thanks
Nagendra
Back to top
View user's profile Send private message
elvis_gn
PostPosted: Fri Aug 20, 2010 2:04 am    Post subject: Reply with quote

Padawan

Joined: 08 Oct 2004
Posts: 1905
Location: Dubai

Hi raj_i2u,

Please paste the ESQL code and a file trace of the InputRoot which contains the parameters sent to Oracle.

Regards.
Back to top
View user's profile Send private message Send e-mail
raj_i2u
PostPosted: Fri Aug 20, 2010 3:05 am    Post subject: Reply with quote

Novice

Joined: 05 Apr 2010
Posts: 15

Here is the eqsl code

***************************************************


CREATE COMPUTE MODULE CAN_Add_Aircraft_AddAircraft
CREATE FUNCTION Main() RETURNS BOOLEAN
BEGIN
Declare inRef Reference To InputLocalEnvironment; -- Reference to the input message
Declare outRef Reference To OutputLocalEnvironment; -- Reference to the output message
-- Variables for cAddRegistration stored procedure call.
Declare UserID CHAR;
Declare ErrorNumber INT;
Declare ErrorMessage CHAR;
Declare DB_IN_PARAMS Reference To OutputLocalEnvironment;
Declare DB_OUT_PARAMS Reference To OutputLocalEnvironment;

CALL CopyMessageHeaders();

-- Move to input message.
Move inRef To InputRoot.XMLNSC.can:esbMessage.can:addAircraftIn;

-- Build output message and namespace declarations.
SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Version = '1.0';
SET OutputRoot.XMLNSC.(XMLNSC.XmlDeclaration)*.(XMLNSC.Attribute)Encoding = 'UTF-8';
Create LastChild Of OutputRoot.XMLNSC As outRef NAMESPACE can Name 'esbMessage';
SET OutputRoot.XMLNSC.can:esbMessage.(XMLNSC.NamespaceDecl)xmlns:can = can;
SET OutputRoot.XMLNSC.can:esbMessage.(XMLNSC.NamespaceDecl)xmlns:cs = cs;

--Map input message attributes to output message.
SET outRef.(XMLNSC.Attribute)LastMessage = InputRoot.XMLNSC.can:esbMessage.(XMLNSC.Attribute)LastMessage;
SET outRef.(XMLNSC.Attribute)MessageType = InputRoot.XMLNSC.can:esbMessage.(XMLNSC.Attribute)MessageType;
SET outRef.(XMLNSC.Attribute)BusinessTransId = InputRoot.XMLNSC.can:esbMessage.(XMLNSC.Attribute)BusinessTransId;
SET outRef.(XMLNSC.Attribute)BusinessCorrelId = InputRoot.XMLNSC.can:esbMessage.(XMLNSC.Attribute)BusinessCorrelId;

Create LastChild Of outRef As outRef NAMESPACE can Name 'addAircraftOut';

-- FAILURE PROCESSING.
-- DB is not able to support requests with AircraftRegistration longer than 12 bytes,
-- or AircraftTypeIATA longer than 3 bytes

IF (LENGTH(inRef.cs:AircraftRegistration) > 12)
OR (LENGTH(inRef.cs:AircraftTypeIATA) > 3) Then
SET outRef.can:Error.cs:ErrorCode = 'EAI:000710';
SET outRef.can:Error.cs:ErrorText = 'Input data is too long for database';
-- End Processing and send message.
RETURN TRUE;
END IF;
-- END OF FAILURE PROCESSING.

SET UserID = InputRoot.XMLNSC.can:esbMessage.(XMLNSC.Attribute)UserID;

-- Call local procedure, in turn calling stored procedure.
CALL cAddRegistration(UserID, ErrorNumber, ErrorMessage, inRef.cs:AircraftRegistration, inRef.cs:AircraftTypeIATA);
-- Look for technical error.
IF (SQLCODE <> 0) then
THROW USER EXCEPTION VALUES (
'ESB',
'FAILED: Data exception',
'EAI:000709',
SQLCODE,SQLERRORTEXT,SQLSTATE,SQLNATIVEERROR,
UserID,ErrorNumber, ErrorMessage, inRef.cs:AircraftRegistration, inRef.cs:AircraftTypeIATA);
END IF;

-- Else no technical error, but procedure may return database error.
IF ErrorNumber <> 0 then
-- An error was returned, so construct error response using returned error handling parameters.
SET outRef.can:Error.cs:ErrorCode = ErrorNumber;
SET outRef.can:Error.cs:ErrorText = ErrorMessage;
-- End Processing and send message.
RETURN TRUE;
END IF;

-- Build response message.
Create LastChild of outRef AS outRef NAMESPACE can Name 'Aircraft';
Set outRef.cs:AircraftRegistration = inRef.cs:AircraftRegistration;
Set outRef.cs:AircraftTypeIATA = inRef.cs:AircraftTypeIATA;

RETURN TRUE;
END;

-- Procedure to call wrapper-ed add registration stored procedure.
CREATE PROCEDURE cAddRegistration(IN USER_ID CHAR, INOUT ERROR_NUMBER INT, INOUT ERROR_MESSAGE CHAR, IN AIRCRAFT_REGISTRATION CHAR, IN AIRCRAFT_TYPE_ID CHAR)
LANGUAGE DATABASE
EXTERNAL NAME "AOMIS.SP_WRAPPER.ad_add_registration";

CREATE PROCEDURE CopyMessageHeaders() BEGIN
DECLARE I INTEGER;
DECLARE J INTEGER;
SET I = 1;
SET J = CARDINALITY(InputRoot.*[]);
WHILE I < J DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I = I + 1;
END WHILE;
END;

END MODULE;
Back to top
View user's profile Send private message
raj_i2u
PostPosted: Fri Aug 20, 2010 3:11 am    Post subject: Reply with quote

Novice

Joined: 05 Apr 2010
Posts: 15

Let me know how to attach files to this forum so tht i can attach the log file

thanks
Back to top
View user's profile Send private message
raj_i2u
PostPosted: Wed Aug 25, 2010 9:40 pm    Post subject: Reply with quote

Novice

Joined: 05 Apr 2010
Posts: 15

Anybody can throw light on the above would be highly appreciable
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 » In parameters have been received in worng order in Database
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.