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



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 not
usable. Reason: No declaration for the variable exists,
the declaration is not within the current scope, or the
variable does not have an equivalent SQL data type.

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

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

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.