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



Definitely some improvements at V5R3.

However this didn't work
     D iimds         e Ds                  extname(iim)
     D ds1             ds                  occurs(10) qualified
     D  rrn                          10s 0
     D  iimflds                            likeds(iimds)

     C/EXEC SQL
     C+ Declare C1 cursor for
     C+ select rrn(a), a.*
     C+   from iim a
     C+   where iprod like 'I%'
     C/END-EXEC

     C/EXEC SQL
     C+ Open C1
     C/END-EXEC

     C/EXEC SQL
     C+ Fetch from C1 for 10 rows into :ds1
     C/END-EXEC

     C/EXEC SQL
     C+ Close C1
     C/END-EXEC

I get SQL5011
DSPMSGD RANGE(SQL5011) MSGF(QSQLMSG)


Rob Berendt
-- 
Group Dekko Services, LLC
Dept 01.073
PO Box 2000
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com





CWilt@xxxxxxxxxxxx 
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
08/17/2004 01:41 PM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>


To
rpg400-l@xxxxxxxxxxxx
cc

Fax to

Subject
RE: Can SQL recognize a nested data structure?






Ben,

I'm pretty sure the answer is no.  Unfortunately, the SQL pre-compiler is
significantly behind the RPG compiler.

Supposed to be some improvements at v5r3.

Charles


> -----Original Message-----
> From: Ben_Pforsich@xxxxxxxxxxxx [mailto:Ben_Pforsich@xxxxxxxxxxxx]
> Sent: Tuesday, August 17, 2004 2:07 PM
> To: rpg400-l@xxxxxxxxxxxx
> Subject: Can SQL recognize a nested data structure?
> 
> 
> 
> 
> 
> 
> I'm trying to load records into a MODS which I want define as 
> having all
> the fields of a particular external file with the addition of 
> a field to
> hold the RRN.  I can do this for single-row fetches, but how 
> do I do this
> for multiple-row fetches where I need to use a MODS?
> 
> <code fragment>
> 
> d JPP010        e ds                  qualified
> d DS1             ds                  occurs(10)
> d   RRN                         10s 0
> d   JPPfields                         likeds(JPP010)
> 
> c/exec SQL
> c+ declare C1 cursor for
> c+   select rrn(A), A.*
> c+     from JRP010 A
> c+    where R1COM = :Company and R1IYR * 100 + R1IWK between
> c+                  :FromIYRIWK and :ToIYRIWK
> c/end-exec
> 
> c/exec SQL
> c+ open C1
> c/end-exec
> 
> c/exec SQL
> c+ fetch from C1 for 10 rows into :DS1
> c/end-exec
> 
> </code fragment>
> 
> I'm getting an SQL precompiler error stating "host structure 
> array DS1 not
> defined or not usable".  When I bypass the SQL precompiler by using
> CRTBNDRPG, I get a little more info:  "LIKEDS keyword is not 
> allowed within
> a data structure that is not qualified"  I could try just 
> defining each
> field in JPP010 in the data structure, but there a lot of 
> fields to define
> and didn't want to make the code more bloated than I had to.
> 
> Has anyone tried something like this successfully?  We're on V5R2.
> 
> 
> Ben Pforsich
> Programmer Analyst
> Bob Evans Farms, Inc.
> I/S Department
> Columbus, Ohio
> Ben_Pforsich@xxxxxxxxxxxx
> 
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) 
> mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
> 
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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.