|
Peter, Whether or not you use DEC() or NUM() as the UDF definition I do not think should matter. But, if you look back in recent posts you'll see things that the SQL pre-compiler does or does not do that are not completely compatible with RPGLE. I had one where a procedure parameter was defined with CONST and I tried to use the %ADDR(). It worked as a SQLRPGLE but not as RPGLE. I do know that RPGLE is supposed to convert similar data types to the actual data types used on procedure parameters where the CONST keyword is specified. I know the SQL can do the same. Can you get away from SQLRPGLE? I thought you indicated that it is the only one that causes issues or in your prepared SQL statement have the UDF return in the results set. Then you might not need to run the same UDF again in the program. SELECT *, ELAPSEDHOURS(ELDATE,ELTIMI,ELDATE,ELTIMO) as ELPSHRS FROM ERPLOG WHERE ELDATE BETWEEN 20020601 AND 20020631 AND ELAPSEDHOURS(ELDATE,ELTIMI,ELDATE,ELTIMO) < 24 P.S. Have you tried to DEBUG the UDF when calling it from the different sources? Thank you, Matt Tyler Mattt@wincofoods.com -----Original Message----- From: Peter Dow [mailto:maillist@dowsoftware.com] Sent: Friday, September 20, 2002 12:17 To: rpg400-l@midrange.com Subject: Re: Using SQL UDF in SQLRPGLE program gets decimal data error Hi Matt, I tried changing the CREATE FUNCTION to use NUMERIC instead of DEC, and it fails with a decimal data error when I try the SELECT interactively. I would've thought it would work since it's zoned to zoned. This is really getting interesting! Peter Dow Dow Software Services, Inc. 909 793-9050 voice 909 522-3214 cellular 909 793-4480 fax ----- Original Message ----- From: "Tyler, Matt" <mattt@wincofoods.com> Sent: Friday, September 20, 2002 7:48 AM Subject: RE: Using SQL UDF in SQLRPGLE program gets decimal data error > I also noticed that the UDF definition specifies that the input > parameters are of DEC() type which equates to a PACKED in RPG. Try using > NUM() (NUMERIC=ZONED) instead since you are only using fields that are > zoned. _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-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.