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



I want to fetch into ddLWRK, which (is my intention) should incorporate
all the fields from ddLWRK1 (i.e. MYVIEW) and ddLWRK2 (i.e. MYTABLE).

Trevor Briggs
Analyst/Programmer
Lincare, Inc.
(727) 431-1246
TBriggs2@xxxxxxxxxxx
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Carel
Teijgeler
Sent: Tuesday, June 03, 2014 11:42 AM
To: RPG programming on the IBM i (AS/400 and iSeries)
Subject: Re: Fetching joined views

Trevor,

which ddlWRK to fetch into: no 1 or no 2?

Regards,
Carel Teijgeler

On 3-6-2014 16:58, Briggs, Trevor (TBriggs2) wrote:
I have a SELECT in an RPG program that joins an existing view MYVIEW
(in QTEMP) and a table MYTABLE. I tried to declare the combined input
buffer like this:



d ddLWRK1 e ds ExtName(MYVIEW)

d ddLWRK2 e ds ExtName(MYTABLE)

d ddLWRK ds Qualified

d ddLWRKDS1 LikeDS(ddLWRK1)

d ddLWRKDS2 LikeDS(ddLWRK2)



and my fetch would be:



exec sql

FETCH SqlCsr Into :ddLWRK;



But I get an "SQL0312: Position 40 Variable DDLWRK not defined or not
usable" error



Is it even possible to do what I'm attempting - i.e. avoiding having
to
define the input fields manually?



We're currently on bare-bones release 7.1.



Thanks,



Trevor Briggs
Analyst/Programmer
Lincare, Inc.
(727) 431-1246
TBriggs2@xxxxxxxxxxx


************************************************************************
************************************************************************
************************************************************
This message originates from Lincare Holdings Inc. It contains
information which may be confidential or privileged and is intended only
for the individual or entity named above.
It is prohibited for anyone else to disclose, copy, distribute or use
the contents of this message.
All personal messages express views solely of the sender, which are
not to be attributed to Lincare Holdings Inc., and may not be copied or
distributed without this disclaimer.
If you received this message in error, please notify us immediately at
MailAdmin@xxxxxxxxxxx or (800) 284-2006.

************************************************************************
************************************************************************
************************************************************


As an Amazon Associate we earn from qualifying purchases.

This thread ...

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.