I assume it's the parameter style.
Parameter style expects some additional (optional) parameters that must be
defined in the procedure interface or *ENTRY PLIST.
Try to recreate your function with parameter style general. With parameter
style general only the defined parameters are passed to the RPG function.
Overloading cannot be the problem, because the function gets called.
If a function is overloaded and the parameters are not passed with the same
data types (BTW length must not be an exact match, because it's not
checked), the function gets not called at all. Be careful CHAR and VARCHAR
are different data types. SMALLINT, INT and BIGINT are also 3 different data
Mit freundlichen Grüßen / Best regards
"Shoot for the moon, even if you miss, you'll land among the stars." (Les
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and loosing them? Not training them
and keeping them!"
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von Alan Shore
Gesendet: Monday, 29. September 2008 17:41
An: Midrange Systems Technical Discussion
Betreff: Creating an SQL function
Good morning all
I am trying to create an SQL function that uses a sub procedure within a
Here is what I attempted
create function MYLIB/AVAILQTY (CHAR, CHAR)
External Name 'PRODLIB/SERVPGM(SUBPROC)'
Parameter Style DB2SQL
When I attempt to use this, for example
SELECT SUFFIX, SKUNO, AVAILQTY(SUFFIX, SKUNO)
FROM ITEMMSTR WHERE SUFFIX = '0011' AND SKUNO = '000070'
What I get is
ITEM SKUNO AVAILQTY
0011 000070 ++++++++++++
The input to the sub procedure is 2 fields 4 characters, 6 characters
The output from the sub procedure is decimal(9,0) as noted above
I'll be honest
I don't know where to start on debugging this
If anyone can help, it would be much appreciated)
Thanks in advance
Programmer/Analyst, Direct Response
P:(631) 244-2000 ext. 5019
"If you're going through Hell, keep going" - Winston Churchill
This mailing list archive is Copyright 1997-2019 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