Solved

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

Posted on 2015-02-10
3
516 Views
Last Modified: 2015-02-15
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
0
Comment
Question by:_ecpirosis_
3 Comments
 
LVL 48

Expert Comment

by:PortletPaul
ID: 40602101
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?
0
 
LVL 18

Accepted Solution

by:
daveslash earned 500 total points
ID: 40602131
Personally, I've never had much success passing a numeric value into a CL stored procedure. I always change the parameter to a *CHAR and do a translation within the CL.

See if that works for you. Obviously, it's not ideal, but it gets the job done.

HTH,
DaveSlash
0
 

Author Closing Comment

by:_ecpirosis_
ID: 40611202
Thank you Dave, it seems impossible in CL to pass decimals. I cannot understand why it is not clearly stated.
Ciao,
Francesco
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Compile Issue with Cusor Loction Solution 3 153
DB2 Log Shipping (Big vs Little Endianness) 4 147
Data transfer to iSeries failing with message ID SQL0462 6 126
DB2 - LOG FILES. 4 30
November 2009 Recently, a question came up in the DB2 forum regarding the date format in DB2 UDB for AS/400.  Apparently in UDB LUW (Linux/Unix/Windows), the date format is a system-wide setting, and is not controlled at the session level.  I'm n…
Recursive SQL in UDB/LUW (you can use 'recursive' and 'SQL' in the same sentence) A growing number of database queries lend themselves to recursive solutions.  It's not always easy to spot when recursion is called for, especially for people una…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now