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



Glenn,

Try extname('VASCCT': *ALL) instead of extname('VASCCT': *OUTPUT).

-mark

On 4/24/2022 8:03 PM, Glenn Gundermann wrote:
I've tried three things with a compile after each:
- removing QUALIFIED from the ds.
- shortening the name to artrans.
- adding ALIAS on the ds.

No change.

Yours truly,

Glenn Gundermann
Email: glenn.gundermann@xxxxxxxxx
Cell: (416) 317-3144

---


On Sun, 24 Apr 2022 at 19:53, Jon Paris<jon.paris@xxxxxxxxxxxxxx> wrote:

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:
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:
Replies:

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.