× 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.




In V5R3, the precompiler requires variable names to be unique through out
all the source in order to be used in an SQL statement. If there are
variables with the same name and are the exact same type, with the same
attributes, and both are stand alone or procedure parameters, then the
duplicated use will be accepted (no SQL0312). The precompiler also lowers
the severity to 11 for the SQL0312, if a duplicate name was found in an SQL
statement and the types were the same (but one wasn't a stand alone or proc
parm). If you specify OUTPUT(*PRINT) and OPTION(*XREF) on the CRTSQLRPGI
command, the listing will have a cross reference section at the bottom.
If you look at that, you can see how and where the precompiler is defining
variables. Also, remember to check variables that are used as a parameter
of the LIKE and LIKEDS keywords. Sometimes those variables are the ones
that are causing the precompiler problems.

The precompiler added variable scoping in 6.1. The support was PTFed
back to 5.4 as well. Duane, can you give me an example in 6.1 where the
precompiler still does not fully understand variable scoping? The only
case that I can think of at this moment is when a variable is used in an
SQL DECLARE CURSOR statement and the OPEN CURSOR statement is used in a
different procedure where there is not a variable defined.

Thanks,
Gina


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.