|
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Alan
Campin
Sent: Monday, September 14, 2015 1:25 PM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Loading arrayDS from sql select into statement?
It is just you. You have to use a declare cursor, open cursor, fetch next
into for number of rows and close your cursor.
On Mon, Sep 14, 2015 at 10:08 AM, Koester, Michael <mkoester@data-
east.com>
wrote:
I'm not real good at using sql set-at-a-time processing, so I'm hopingtold).
someone can give me some clues.
I'm okay with declaring cursors, and loading arrays with a multi-row
fetch, or from "fetch next" inside a for-loop. I'm trying to improve
my coding techniques, and understand the options.
I've seen mentions on this list of using "select into :ArrayDS", but
whenever I try to code up such a thing, the sql precompiler says I
can't - tells me my array is no good.
Specifically, "SQL0312: Position 16 Variable ArrayDS not defined or
not usable."
I've tried all kinds of adjustments to simplify the host data
structure to appease the precompiler, but it is not in the mood.
Compiling with CRTSQLRPGI on v7.1 with mostly up-to-date PTFs (I'm
Could be missing one?"where"
Or could be that I don't know what I'm doing. Or could be no one else
can do this either?
Code that DOES NOT work:
DCL-DS ArrayDS QUALIFIED DIM(64);
userAcct CHAR(50);
END-DS ;
// dds-defined physical file SV02 has 3 records that meet
criteria.
// sv2eml is defined as character 50; sv2sts is defined as
character 1.
exec sql
select sv2eml into :ArrayDS
from sv02
where sv2sts = '';
Is it just me ??? Thanks.
Michael Koester
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.