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 » Handling NULL values in Procedure(function)

Post new topic  Reply to topic
 Handling NULL values in Procedure(function) « View previous topic :: View next topic » 
Author Message
mahek
PostPosted: Wed Jun 29, 2005 7:17 am    Post subject: Handling NULL values in Procedure(function) Reply with quote

Voyager

Joined: 10 Sep 2004
Posts: 87

Hi all,
This is the error that i am getting while calling a Procedure

A function or procedure was called but the value supplied for the 'inputValue' parameter was of type 'NULL' but the function/procedure expects value of type 'CHARACTER' Functions and procedures require an exact matching between the data type of values supplied as parameters and the data type in its definition. Examine and correct the SQL program

Here is that Procedure that i am using

setVendorProductUpdate(IN inputValue CHAR,IN tagName CHAR, INOUT VendorProductUpdateCounter INTEGER )
The inputValue(the first parameter in theprocedure) can be NULL .When the inputValue is not null the code is working properly but when it is null it is giving this error .
Back to top
View user's profile Send private message
JT
PostPosted: Wed Jun 29, 2005 7:35 am    Post subject: Reply with quote

Padawan

Joined: 27 Mar 2003
Posts: 1564
Location: Hartford, CT.

Post the ESQL code leading up to, and including the CALL statement.
Back to top
View user's profile Send private message
mahek
PostPosted: Wed Jun 29, 2005 8:31 am    Post subject: Reply with quote

Voyager

Joined: 10 Sep 2004
Posts: 87

SET OutputRoot.XMLNS."mms-txn:MMSTransaction"."mms-txn:MMSTransactionBody"."product:Product"."product:VendorProductUpdate"."product:Field"[VendorProductUpdateCounter]=TRIM(InputRoot.MRM.SP_INYUPC_IUPC);
SET OutputRoot.XMLNS."mms-txn:MMSTransaction"."mms-txn:MMSTransactionBody"."product:Product"."product:VendorProductUpdate"."product:Field"[VendorProductUpdateCounter].(XML.attr)NAME='SellUPC';
SET VendorProductUpdateCounter= VendorProductUpdateCounter+1;
CALL setVendorProductUpdate( InputRoot.MRM.SP_INVMST_IDESCR,'Vendordescrip',VendorProductUpdateCounter);

CREATE PROCEDURE setVendorProductUpdate(INOUT inputValue CHAR,IN tagName CHAR, INOUT VendorProductUpdateCounter INTEGER ) BEGIN
IF inputValue is not NULL THEN
SET OutputRoot.XMLNS."mms-txn:MMSTransaction"."mms-txn:MMSTransactionBody"."product:Product"."product:VendorProductUpdate"."product:Field"[VendorProductUpdateCounter]=TRIM(inputValue);
SET OutputRoot.XMLNS."mms-txn:MMSTransaction"."mms-txn:MMSTransactionBody"."product:Product"."product:VendorProductUpdate"."product:Field"[VendorProductUpdateCounter].(XML.attr)NAME=tagName;
SET VendorProductUpdateCounter= VendorProductUpdateCounter+1;
END IF;
END;
Back to top
View user's profile Send private message
Maximreality
PostPosted: Thu Jun 30, 2005 6:31 am    Post subject: Reply with quote

Acolyte

Joined: 04 Jun 2004
Posts: 65
Location: Copenhagen

You can use Coalesce and provide a second parameter that has a default value that indicates the first value is Null

Code:
CALL setVendorProductUpdate(COALESCE(InputRoot.MRM.SP_INVMST_IDESCR, '||'),'Vendordescrip',VendorProductUpdateCounter);


Code:
CREATE PROCEDURE setVendorProductUpdate(INOUT inputValue CHAR,IN tagName CHAR, INOUT VendorProductUpdateCounter INTEGER ) BEGIN
IF inputValue = '||' THEN
Do your stuff here if the value is Null;
END IF;


/Rasmus
Back to top
View user's profile Send private message
mgk
PostPosted: Thu Jun 30, 2005 10:28 am    Post subject: Reply with quote

Padawan

Joined: 31 Jul 2003
Posts: 1642

Hi,

I'm not sure what level of the broker you are running, but their is a known problem with an exception being thrown when passing NULL to an IN or INOUT parameter to a procedure. If you raise a PMR you should be able to get an efix (I'm not sure if this is in V5 CSD5 or not.) It is certainly not in CSD4 or earlier...

Regards,
_________________
MGK
The postings I make on this site are my own and don't necessarily represent IBM's positions, strategies or opinions.
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 » Handling NULL values in Procedure(function)
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.