|
I've not tried this myself Glenn - but try adding the ALIAS keyword to the
DS definition - that will cause the compiler to bring in the long field
names. Don;t kn ow if SQL will accept it but ...
Also I don't think you need QUALIFIED on that DS.
Jon P.
On Apr 24, 2022, at 6:53 PM, Glenn Gundermann <glenn.gundermann@xxxxxxxxx> wrote:
not
Hi folks,
After not working with RPG and embedded SQL for four years, I feel I'm
starting all over and some of it is not easy.
Basically, with a SQLRPGLE member, I'm trying to define a DS and using
FETCH NEXT FROM cursorName INTO dsName.
it won't compile and I'm getting:
SQL0312 30 105 Position 34 Variable ARTRANSACTIONS not defined or
usable. Reason: No declaration for the variableexists,
the declaration is not within the current scope, orthe
variable does not have an equivalent SQL data type.related questions.
Below are parts of the program. In the compile listing, it shows
ARTRANSACTIONS as undefined. What am I missing? The SQL statement works
when I copy it into Run SQL Scripts.
dcl-f vascct disk usage(*output);
dcl-ds arTransactions extname('VASCCT': *OUTPUT) qualified;
end-ds;
exec sql
DECLARE arCursor CURSOR FOR long-sql-select-statement;
exec sql
OPEN arCursor;
exec sql
FETCH NEXT FROM arCursor INTO :arTransactions;
dow sqlState = '00000';
write vascctr arTransactions;
exec sql
FETCH NEXT FROM arCursor INTO :arTransactions;
endDo;
exec sql
CLOSE arCursor;
Yours truly,
Glenn Gundermann
Email: glenn.gundermann@xxxxxxxxx
Cell: (416) 317-3144
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
link: https://amazon.midrange.com
Help support midrange.com by shopping at amazon.com with our affiliate
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.
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.