× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



M.

I doubt it's the library issue. I always create mine in QGPL just so I don't
have to worry about library lists.

I believe it's the way parameters are passed to the stored procedure.  SQL
checks entire procedure signature for match when it looks for it and that
includes checking data type of input parms.
By default literal values are passed as VARCHARs, not CHARs.  You'll either
have to change your stored procedure declaration or explicitly cast the
inputs in your trigger as CHARs, i.e. (CHAR('D'), CHAR('FTPSERVER') ...).
I recommend 2nd option (casting) since CL can't handle VARCHAR input well.

Elvis

-----Original Message-----
Subject: SQL0440 with Trigger and Stored Procedure

I'm trying to get a stored procedure working.  Just to let you know... 
this is the first time I've try to do this.  Ok.  I created a stored 
procedure with the following syntax :
CREATE PROCEDURE MFPUT_SP1 (CHAR(1), CHAR(10), CHAR(10), CHAR(10), CHAR
(10)) EXTERNAL NAME mylib/OURFTP LANGUAGE CL

This Stored procedure will be called by a database trigger that was 
defined by the following syntax :
CREATE TRIGGER MFPUT_T1 AFTER INSERT ON mylib/MFPUT CALL MFPUT_SP1 
('D', 'FTPSERVER ', 'FTPUSER   ', 'mylib     ', 'MEMBER    ')

So, after a record is added to table MFPUT I want the Trigger to call 
my Stored Procedure which runs my CL program. See, simple.

The CL program has the following parameters :
 DCL    VAR(&VERSION)   TYPE(*CHAR)   LEN(1)
 DCL    VAR(&SERVER)    TYPE(*CHAR)   LEN(10)
 DCL    VAR(&FTPUSER)   TYPE(*CHAR)   LEN(10)
 DCL    VAR(&PARMLIB)   TYPE(*CHAR)   LEN(10)
 DCL    VAR(&PARMMBR)   TYPE(*CHAR)   LEN(10)

When I start another session and use DFU to add a record I get the 
following error :
SQL0440 : Routine OURFTP in mylib not found with specified parameters
SQL0723 : SQL trigger MFPUT_TI in *N failed with SQLCODE -440 SQLSTATE 
42884.

The mylib library is in the System part of the libary list and the 
userid has access to the library.

Any thoughts?
m.






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.