Do you have any global D-Specs?
If not just define any global variable.
Sometime ago I run into those problems if no global D-Specs were defined or
all global D-specs were located within copy members.
I assume the SQLCA is included at the end of the first D-specs that is
found.
I always include the SET OPTION statement immediately after the global
D-specs, independent whether the source includes a cyclic main procedure or
not and always add a dummy D-Spec.
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 [mailto:rpg400-l-bounces@xxxxxxxxxxxx] Im Auftrag von
Englander, Douglas
Gesendet: Monday, 06.4 2015 19:07
An: 'rpg400-l@xxxxxxxxxxxx'
Betreff: SQL Precompiler issue
Has anyone else experienced this:
There is an SQLRPGLE program with subprocedures, some of the subprocedures
use SQL, and others do not. The problem is that the SQL Precompiler is
recognizing the SQL code, and adding the SQL Data Structure, but, it adds
the Data Structure as a local DS in one of the subprocedures, AND the
subprocedure where the DS is added does not have any SQL code in it.
Moreover, the other subprocedures that do have SQL, and need the DS cannot
see it because the DS that was added is defined locally to that
subprocedure.
The first occurrence of the EXEC SQL command is in the mainline, but only to
set the SQL COMMIT parameter to *NONE. The first occurrence of an actual SQL
command to execute is in one of the subprocedures.
We are on V7R1.
Are there PTFs that can address this, or is it a known problem that the SQL
precompiler does not work well with subprocedures?
Thank you,
Doug
--
This is the RPG programming on the IBM i (AS/400 and 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.