× 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.



Okay, I'm around the bend on this one.

I've checked Rob B's detailed example from April 2005 and I'm still 
befuddled. I don't seem to be able to get stored procedures working when I 
compile them using RUNSQLSTM; I have another simple SQL stored procedure 
which compiles but also gets a "not found" but works when I enter it from 
OpsNav. I'm on V5R3 with all the goodies installed.

Here's my QSQLSRC source member. It compiles okay with RUNSQLSTM (according 
to the listing). Nothing shows up with WRKOBJ but I can see it with OpsNav.

create function TEST/SPS011 (dec (15,2), char (2), char (2), date) 
returns dec (15,2) 

language RPGLE 
is deterministic 
no SQL 
returns null on null input 
no external action 
allow parallel simple call 

external name 'TEST/SVV011(SVV011)' 

The service program SVV011 has a single procedure, SVV011, and it's in 
production. I use binder language, not EXPORT(*ALL). The prototype looks 
like this:
 Dsvv011 pr 15 2 
 D Qold_amount 15 2 const 
 D Qbase_currency 2 const 
 D Qnew_currency 2 const 
 D Qeff_date d const datfmt(*iso)

When I add TEST to the top of the library list and STRSQL this statement:
SELECT ordernum,order,amount,sps011(amount,'CA','US',current_date) as newamt 
from orders

I get this:
SPS011 in *LIBL type *N not found.

"Amount" is (9,2). The SQL Reference Manual advises the function signature 
is made up from the number of parameters and data types, not size. My SQL 
attributes have the date format set to *ISO
I'm using DAFMT(*ISO) on the RUNSQLSTM command.

Should the stored procedure be in the same schema (library) as the table? Do 
I have a problem with the function signature? Is this not allowable with 
interactive SQL? Or is there something else I've missed?

Thanks,
Guth

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.