× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Glad to be of help.

I'd agree that it is nice but not particularly perfect.  In fact, it often
bits me in the a** and I have to relearn this particular lesson.  I think
I'm finally to the point where the first thing I look for, when the SQL
pre-compiler says my host variable is unusable, is a non-unique name.

Actually, I should point out (for the archives if nothing else) that the
globally unique requirement is there regardless of rather you are using
global or local variables  in the embedded SQL.  The pre-compiler only has a
global namespace into which it throws all global and local variable names
defined in the RPG program.  Nor has this been corrected in v5r3.


As to your last question...yep been there done that!  ;-)

Charles

> -----Original Message-----
> From: Joel Cochran [mailto:jrc@xxxxxxxxxx]
> Sent: Wednesday, August 25, 2004 6:06 AM
> To: RPG programming on the AS400 / iSeries
> Subject: RE: Subroutines vs Subprocedures was RE: Indicators
> 
> 
> On Wed, 2004-08-25 at 13:21, CWilt@xxxxxxxxxxxx wrote:
> > Joel,
> > 
> > Actually this works ok even at v5r2 (v5r1?)  as long as the 
> local variable
> > has a (globally) unique name.
> 
> Thanks Charles, I tested this at V5R1 and it certainly does work.  So
> once again I learn something before 10am... my work here is done :-)
> 
> Wouldn't you want to avoid this though?  You would have to ensure that
> the local variable name is unique, which kind of defeats the 
> purpose of
> making it local... although, back to my other statements about
> guaranteed initialization and similar items, I guess I can 
> see a benefit
> to this.  In fact, this could come in very handy when using columnar
> functions and such for calculations... hmmm... now you've got me
> thinking...
> 
> As an aside, I wonder how I got hung up on the idea that SQL couldn't
> use ANY local variables.  I obviously believed it enough to assert it,
> both here and in my articales, so I have to wonder what made me so
> confident about that.  Does that ever happen to anyone else?  
> You think
> you understand something completely and then find out you've been
> mistaken all along?
> 
> My apologies to all for spreading an inaccuracy.
> 
> Joel
> http://www.rpgnext.com
> 
> --
> 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 thread ...


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

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.