Jay/Elvis,
I have defined all the 3 parms as 'a' data type in sqlrpgle and in SQL I
call with parameters in quotes Select * from
table(fn('parm1','parm2','parm3'))x.  Moreover, I don't have any other
function in that name in the entire system.

In Java - as string.

                                        stmt.setString(1, parm1);
                                        stmt.setString(2, parm2);
                                        stmt.setString(3, parm3);

                                        //call it.
                                        ResultSet rs =
stmt.executeQuery();

Thanks,
Sudha
Sudha Ramanujan
SunGard Futures Systems
sramanujan@xxxxxxxxxxxxxxxxxx
(312) 577 6179
(312) 577 6101 - Fax


-----Original Message-----
From: Elvis Budimlic [mailto:ebudimlic@xxxxxxxxxxxxxxxxxxxxxxxxx] 
Sent: Monday, March 22, 2004 3:06 PM
To: 'Midrange Systems Technical Discussion'
Subject: RE: UDTF with SQL and JDBC call

Good point!  
UDFs follow a convention of "function overloading".  Basically it means
that
you can have a function that has the same name but depending on the
input
parms (int, short, bigint, ...) has a different signature and hence
takes
different code path.  

More descriptive error message would have helped.
Oh well, I guess it just means it can't find the exact signature and
accordingly figures there is no function user requested.  

Sudha, make sure your input parms data type exactly matches your UDF
parms.
This may require type casting, as pointed out by Jay.

Elvis

-----Original Message-----
 Subject: RE: UDTF with SQL and JDBC call

A problem I have had with UDFs is that they can be very picky about the
input parameters.

For example GETRELSEQ takes an integer but c1nmid is numeric(9,0) - Here
are
the results:

select GETRELSEQ(c1nmid)              
 from nammsp where c1nmid = 1         
GETRELSEQ in *LIBL type *N not found. 

select GETRELSEQ(int(c1nmid))    
 from nammsp where c1nmid = 1    
SELECT statement run complete. 

Char parms in particular often need to be cast to the right length.

Jay Himes
Liberty University



_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...


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

This mailing list archive is Copyright 1997-2022 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.