|
... And numeric values without decimal precision are interpreted as integer. For stored procedures, passing input parameters in this way should be no problem, because the parameters are converted into the expected data type and length (comparable to CONST keyword in RPG). For user defined functions the literals must be converted into the expected parameter type otherwise the function cannot be found. When passing a character literal and the UDF expects a parameter defined as CHAR, the function will not be found, because the character literal is passed as VarChar. Also, when passing a numeric value and decimal or numeric definition are expected, the function will not befound, because the numeric values are interpreted as integers. Mit freundlichen Grüßen / Best regards Birgitta Hauser "Shoot for the moon, even if you miss, you'll land among the stars." (Les Brown) "If you think education is expensive, try ignorance." (Derek Bok) "What is worse than training your staff and losing them? Not training them and keeping them!" -----Ursprüngliche Nachricht----- Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von Vernon Hamberg Gesendet: Friday, January 26, 2007 02:33 An: RPG programming on the AS400 / iSeries Betreff: Re: AW: store procedure - parameter passing I think what I say is still true - character literals are passed as VARCHAR() - this can be a real surprise. For this reason, to allow me to use literals in the parameters, I declare character parameters as VARCHAR() all the time. Vern At 12:25 PM 1/25/2007, you wrote:
Attention! Overloading means, that the same procedure can exist with a different number of parameters in the same schema. But these procedures are different programs that can do something completely different. For Stored Procedures only the number of parameters and the data types are checked, but not the length. Also compatible data types (such as Decima, Integer) can be passed for numeric fields, and CHAR(), VARCHAR(), GRAPHS() can be passed for character fields. The length of the parameters is not checked. For User Defined Functions, overloading is slightly different. In the same schema several UDFs with the same name can coexist, Mit freundlichen Grüßen / Best regards Birgitta Hauser "Shoot for the moon, even if you miss, you'll land among the stars." (Les Brown) "If you think education is expensive, try ignorance." (Derek Bok) "What is worse than training your staff and losing them? Not training them and keeping them!" -----Ursprüngliche Nachricht----- Von: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von rob@xxxxxxxxx Gesendet: Thursday, January 25, 2007 19:00 An: RPG programming on the AS400 / iSeries Betreff: Re: store procedure - parameter passing Pretty sure you do. Stored procedures support "overloading". You can have the same procedure, with the same name, out there multiple times. The differentiator being the parameters. It would be like having an RPG subprocedure called AddDaysToDate and automatically determining on the type of the first parameter if you are working with character, numeric, true dates, etc. Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com "Lim Hock-Chai" <Lim.Hock-Chai@xxxxxxxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 01/25/2007 11:13 AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx> cc Subject store procedure - parameter passing when calling a store procedure, do I have to pass the exact length of the inpur parm? Using the following procedure as an example CREATE PROCEDURE AILSEQMSP ( In inSerialNo Char(15), In inOffice Char(3), In InSystem Dec(1,0), Out outErrFlag Dec(1,0), Out outErrCode Char(7), Out TotalRecords Dec(8,0) ) Result Sets 1 Language RPGLE External name AILSEQMRP would the following different call statement make a different? - call AILSEQMSP('A ', ' ', 1, rsParm1, rsParm2, rsParm3) - call AILSEQMSP('A', ' ', 1, rsParm1, rsParm2, rsParm3) - call AILSEQMSP('A ', '', 1, rsParm1, rsParm2, rsParm3) thanks. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx 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-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.