|
Hi Guth, >>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)' >>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. Your problem is neither Amount, nor the current_date, but the second and third parameter. You defined these 2 parameters as CHAR(2), which means fixed length. If you specify literals in an SQL Stored Procedure or Function call, they are treated as VARCHAR. For SQL VARCHAR and CHAR are different data types. If you cast your second and third parameter to CHAR, the function should be found. Birgitta Mit freundlichen Grüßen i.A. Birgitta Hauser LUNZER + PARTNER GMBH Unternehmensberatung Carl-Zeiss-Straße 1 63755 Alzenau Tel: + 49 6023 951-255 Fax: + 49 6023 951-111 Internet. www.lp-gmbh.com <http://www.lp-gmbh.com> www.rpg-schulung.de <http://www.rpg-schulung.de>
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 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.