|
Are you getting the SQL0312 for fields? You defined your data structure as
fieldDs.
dfieldDs ds
d field1 5a
d field2 15p 2
d field3 30a
c/exec sql fetch next from c into :fields :myNullAry
c/end-exec
In V5R3, there is a new parameter called RPGPPOPT:
RPG preprocessor options (RPGPPOPT) - Help
Specifies if the RPG compiler will be called to preprocess
the source member before the SQL precompile is run.
Preprocessing the SQL source member will allow some
compiler directives to be handled before the SQL
precompile. The preprocessed source will be placed in
file QSQLPRE in QTEMP. This source will be used for the
SQL precompile.
*NONE
The compiler is not called for preprocessing.
*LVL1
The compiler is called for preprocessing to expand
/COPY and handle the conditional compilation
directives except the /INCLUDE directive.
*LVL2
The compiler will be called for preprocessing to
expand /COPY and /INCLUDE and handle the conditional
compilation directives.
So with *NONE, which is the default, the precompiler can handle
one level of /Copy and does not read /INCLUDE.
Another common reason for getting SQL0312 is that you have the host
variable
defined more than once. The precompiler never has handled scoping of
variables
and requires all variables to be unique, even if they are in different
procedure.
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.