|
Thanks Vern. My latest status. I changed the whole scenario to varchar and varying in my calling and called sqlrpgle. Within the function-program, I use the inputs as where clause in the select. Now I get the sql error of record not found when I call from sqlrpgle. It works very well in interactive sql without any typecast. My java servlet does not work either way. With static fields and with varchar. I have defined the inparm fields as String within Java. Should I be declaring them as something else? Thanks, Sudha Sudha Ramanujan SunGard Futures Systems sramanujan@xxxxxxxxxxxxxxxxxx (312) 577 6179 (312) 577 6101 - Fax -----Original Message----- From: Vern Hamberg [mailto:vhamberg@xxxxxxxxxxxxxxxxxxxxxxxxx] Sent: Tuesday, March 23, 2004 8:29 AM To: Midrange Systems Technical Discussion Subject: RE: UDTF with SQL and JDBC call Hi, Sudha Glad that worked. It makes things a little sticky for the user, to have to remember ot cast the literal, however. It might be easier, more usable, to declare the character parms as VARCHAR. SQL takes care of everything for you - if you pass it a CHAR, it'll convert as needed, and you don't need to pass the length, it takes care of that, too. Also, the called function does not need the length for the VARCHAR, as I had expected at first. HTH Vern At 07:29 PM 3/22/2004 -0600, you wrote: >Oh! This is what I needed to do!.. >I had to type cast it as char('literal'). > >Thank you all so much! >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 4:28 PM >To: 'Midrange Systems Technical Discussion' >Subject: RE: UDTF with SQL and JDBC call > >Sudha, one more thought comes to mind. >Are you passing literals in your tests? >For example, function excepts a short and you are passing '33' in. >System will use a default of 'INTEGER' data type and hence you will have >your function mismatch and message that "fn" could not be found. >For character it will assume VARCHAR for literals. > >Bottom line is, either define your function as VARCHAR or typecast the >literal with CHAR('mycharinput'). > >Ideal fix is to create several stored procedures with all these varying >data >inputs and have them all point to the same UDF. Then you don't have to >worry about passing in literals or not. > >Best way to check what you have defined as data type for input parms is >to >query the SYSFUNCS system table. > >Elvis _______________________________________________ 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 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.