Solved

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

Posted on 2015-02-10
3
604 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_
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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:
Dave Ford 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

Business Impact of IT Communications

What are the business impacts of how well businesses communicate during an IT incident? Targeting, speed, and transparency all matter. Find out more in this infographic.

Question has a verified solution.

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

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 (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

751 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