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 » INVOKE DB2 EXTERNAL PROCEDURE

Post new topic  Reply to topic
 INVOKE DB2 EXTERNAL PROCEDURE « View previous topic :: View next topic » 
Author Message
danielaphex
PostPosted: Tue Sep 16, 2003 5:57 am    Post subject: INVOKE DB2 EXTERNAL PROCEDURE Reply with quote

Apprentice

Joined: 07 Apr 2003
Posts: 28

Hi there,

I hope you can help me.

I developed a flow which call a external DB2 procedure which has four parameters (three to receive and one to return). One of the parameters I have to pass throught this procedure is the MsgId of the incoming message to be used for the procedure to GET a message of a queue with the specified MsgId. I need this value to be in binary form (24 positions) so I pass the parameter (in the call of the compute node) as a CHAR. The problem comes when passing this parameter to the procedure as CHAR due to DB2 server make a transformation from this ASCII format to EBCDIC having problems with some characters no printables.
After some tries we have changed the procedure definition in DB2 definind this field as CHAR that accepts binary data (theorically does not make the transformation) but now when I execute the flow I obtain the following exception:


Quote:

Sep 16 15:47:37 eaidesa WMQIv210[59436]: (EAIBKDESA1_BK.Grupo_DPG)[2619]BIP2322E
: Database error: SQL State '22005'; Native Error Code '-99999'; Error Text '[IB
M][CLI Driver] CLI0112E Error in assignment. SQLSTATE=22005'. : EAIBKDESA1_BK.1
14f8f4c-f200-0000-0080-cfb54220f4dc: /build/S210_P/src/DataFlowEngine/ImbOdbc.cp
p: 247: ImbOdbcHandle::checkRcInner: :



If you are interested the code I am using in my Compute node is the following:

Quote:

DECLARE C INTEGER;
SET C = CARDINALITY(InputRoot.*[]);
DECLARE I INTEGER;
SET I = 1;
WHILE I < C DO
SET OutputRoot.*[I] = InputRoot.*[I];
SET I=I+1;
END WHILE;
-- Entre SQL bajo esta línea. Es posible que el SQL por encima de esta línea deba regenerarse, con lo cual se perderían todas las modificaciones.

----------------------------------------------------------------------------------------------------------------------
-- Declaracion de variables
DECLARE NUMEROREINTENTOS INTEGER;
DECLARE NUMEROREINTENTOSRECUPERADOS INTEGER;
DECLARE CODIGO_PAGINA INTEGER;
DECLARE CODIGO_RETORNO CHAR;
DECLARE BLOQUEADO CHAR;
DECLARE RESULTADO CHAR;
DECLARE CORRELATIONID CHAR;
DECLARE COLASALIDA CHAR;
DECLARE GESTORDECOLASACTUAL CHAR;
DECLARE COLARESPUESTA CHAR;
DECLARE GESTORCOLASRESPUESTA CHAR;
DECLARE COLAMASGESTOR CHAR;
----------------------------------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------------------------------
-- Asignacion de variables

-- Codigo Pagina
SET CODIGO_PAGINA = 819;
SET GESTORDECOLASACTUAL = 'A';
SET COLASALIDA = 'A.QUEUE';


-- CorreliD que sera pasado como parametro al procedimiento
SET CORRELATIONID = CAST(InputRoot.MQMD.CorrelId AS CHAR CCSID CODIGO_PAGINA);

-- Se invoca el procedimiento almacenado
CALL PROCEDIMIENTOALMACENADO (CODIGO_RETORNO , CORRELATIONID , GESTORDECOLASACTUAL , COLASALIDA);


SET OutputRoot.XML.Mensaje.CodRetorno = COALESCE(CODIGO_RETORNO,'');

-----------------------------------------------------------------------------------------
-- Se define el procedimiento almacenado al que se debe llamar
CREATE PROCEDURE PROCEDIMIENTOALMACENADO (OUT SALIDA1 CHARACTER , IN ENTRADA1 CHAR , IN ENTRADA2 CHARACTER ,IN ENTRADA3 CHARACTER) EXTERNAL NAME "SYSPROC.HZRXD40";
-----------------------------------------------------------------------------------------



To end I would like to warn that with this same code I am able to connect the stored procedure if the definition of the field on it (over DB2) is a normal CHARACTER.

I would really appreciate anyones help.

Cheers
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 » INVOKE DB2 EXTERNAL PROCEDURE
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.