Link to home
Start Free TrialLog in
Avatar of _ecpirosis_
_ecpirosis_

asked on

error 42884 - reason code -440 sqlmessage [SQL0440] calling a cl procedure from a db2 stored procedure

Hi,
I have a stored defined as follows:
CREATE PROCEDURE RESTTEST.GETPRC4 (
      IN P1 CHAR(10) ,
      INOUT P2 DECIMAL(10, 0) )
      DYNAMIC RESULT SETS 1
      LANGUAGE CL
      SPECIFIC RESTTEST.GETPRC4
      NOT DETERMINISTIC
      MODIFIES SQL DATA
      CALLED ON NULL INPUT
      EXTERNAL NAME 'FBSOBJ/DTARA0C'
      PARAMETER STYLE SQL ;

that calls 'FBSOBJ/DTARA0C'  a cl program defined as follows:


PGM        PARM(&DTNAME &DTVAL)                          
                                                                       
             DCL        VAR(&DTNAME) TYPE(*CHAR) LEN(10)              
             DCL        VAR(&DTVAL)  TYPE(*DEC)  LEN(10 0)              
                                                                       
             ALCOBJ     OBJ((&DTNAME *DTAARA *EXCL *N))                
                                                                       
             RTVDTAARA  DTAARA(&DTNAME *ALL) RTNVAR(&DTVAL)            
                                                                       
      /* set output value                 */  
             CHGVAR     VAR(&DTVAL) VALUE(&DTVAL + 1)                  
                                                                       
             CHGDTAARA  DTAARA(&DTNAME *ALL) VALUE(&DTVAL)            
                                                                       
             DLCOBJ     OBJ((&DTNAME *DTAARA *EXCL *N))                                                                    
ENDPGM

calling stored as

 call resttest.getprc4('1234567890',0)

I get the error 42884 - reason code -440  sqlmessage [SQL0440]
I have only the italian version:  La routine DTARA0C in FBSOBJ non è stata trovata con i parametri specificati.
Causa. . . . . :   Una funzione o procedura con il nome specificato e gli argomenti compati
bili non sono stati trovati. Correzione   . . . :   Specificare il numero e il tipo di parame
tri corretti sull'istruzione CALL o richiamo di funzione. Immettere di nuovo la richiesta.

It states that no compatible CL routine was found: wrong parameters.

Any suggestion?  I already changed parameter style but no effect, always the same message.
Plese note that if I use a different number of parameter in call (es call resttest.getprc4('1234567890',0,?) )
I get the same message but referred to  getprc4.
In my opinion this means that the call finds out the CL routine but it does not match for parameter number.

Thank you in advance.
Francesco
Avatar of PortletPaul
PortletPaul
Flag of Australia image

my only contribution here, and it's by google translate:

The routine DTARA0C in FBSOBJ was not found with the specified parameters .
Cause . . . . . : A function or procedure with the specified name and arguments compati
bili were not found . Correction . . . : Specify the number and type of parame
tri correct education CALL or function call . Enter the request again .

Seems to be indicating it has found it, but the parameter [ numbers-of | datatypes-of | order-of ] isn't correct

do you have any successful call to that external procedure?
any documentation?
the code of it?
can you call it manually?
ASKER CERTIFIED SOLUTION
Avatar of Member_2_2484401
Member_2_2484401
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of _ecpirosis_
_ecpirosis_

ASKER

Thank you Dave, it seems impossible in CL to pass decimals. I cannot understand why it is not clearly stated.
Ciao,
Francesco