Hi Jerry, could you be running into this restriction?

Using the multiple-row FETCH statement
The multiple-row FETCH statement can be used to retrieve multiple rows from
a table or view with a single FETCH statement. The program controls the
blocking of rows by the number of rows requested on the FETCH statement
(The Override Database File (OVRDBF) command has no effect.). The maximum
number of rows that can be requested on a single fetch call is 32 767.
After the data is retrieved, the cursor is positioned on the last row
retrieved.

Extracted from the IBM i Database SQL programming manual.

Sounds like you may be extending past the limit when you increase to 50,000.

Rob

On Fri, Apr 8, 2022 at 9:13 AM (WalzCraft) Jerry Forss <JForss@xxxxxxxxxxxxx>
wrote:

Here is some of the code.

When I change the elements to 30000 it compiles. At 50000 it does not.

I have also tried it a Mult occurrence DS

// Result Set
Dcl-DS Results Dim(50000) Qualified Inz;
RCustNo Char(8);
RAttr Char(20);
RAttrDesc Char(100);
RAttrValue Char(100);
End-DS;

DIAGNOSTIC MESSAGES
MSG ID SEV RECORD TEXT
SQL5011 30 509 Position 29 Host structure array RESULTS not defined
or
not usable. Reason: The dimension of the host
structure
array is larger than what is supported by SQL.
Message Summary


Exec SQL
Set Result Sets Array :Results For :Row Rows;


-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Charles
Wilt
Sent: Thursday, April 7, 2022 10:42 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: External Re: Stored Procedure with large result set

CAUTION: This email originated from outside of the organization. Do not
click links or open attachments unless you recognize the sender and know
the content is safe.

Jon,

Never said he was...given that he didn't mention the error, just that it
was a compiler error, I said it was an RPG limit..

Which one, I don't have enough info to know.

Charles


On Thu, Apr 7, 2022 at 4:32 PM Jon Paris <jon.paris@xxxxxxxxxxxxxx> wrote:

There is no 32K array size limit in RPG Charles.

Jon P.


On Apr 7, 2022, at 1:00 PM, Charles Wilt <charles.wilt@xxxxxxxxx>
wrote:

I assume this is an RPG program/prodedure being used as a SQL
externally defined stored procedure?

How is the RPG generating the results set?

Sounds like you're trying to build an array(?) in RPG and return
that as
a
result set?
And running into RPG limits, in that case nope.

You'd need to switch to using an SQL cursor to return a bigger
result
set.

Charles

On Thu, Apr 7, 2022 at 10:54 AM (WalzCraft) Jerry Forss <
JForss@xxxxxxxxxxxxx> wrote:

Hi All,

I have a request for a Stored Procedure that will return a result
set
with
around 50,000 rows.
It seems the limit is set at around 32,000 rows, otherwise the pgm
will not compile.

There are over 3 million records in the file that I want to return
a subset.
This is called from the network side of the world.

Is there any way around this limit?



Subject to Change Notice:

WalzCraft reserves the right to improve designs, and to change
specifications without notice.

Confidentiality Notice:

This message and any attachments may contain confidential and
privileged information that is protected by law. The information
contained herein
is
transmitted for the sole use of the intended recipient(s) and
should
"only"
pertain to "WalzCraft" company matters. If you are not the intended
recipient or designated agent of the recipient of such information,
you
are
hereby notified that any use, dissemination, copying or retention
of
this
email or the information contained herein is strictly prohibited
and may subject you to penalties under federal and/or state law. If
you received this email in error, please notify the sender
immediately and
permanently
delete this email. Thank You

WalzCraft PO Box 1748 La Crosse, WI, 54602-1748
www.walzcraft.com<http://www.walzcraft.com> Phone: 1-800-237-1326
--
This is the RPG programming on IBM i (RPG400-L) mailing list To
post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: https://amazon.midrange.com

--
This is the RPG programming on IBM i (RPG400-L) mailing list To post
a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: https://amazon.midrange.com

--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe,
or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription
related questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com

--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com



Subject to Change Notice:

WalzCraft reserves the right to improve designs, and to change
specifications without notice.

Confidentiality Notice:

This message and any attachments may contain confidential and privileged
information that is protected by law. The information contained herein is
transmitted for the sole use of the intended recipient(s) and should "only"
pertain to "WalzCraft" company matters. If you are not the intended
recipient or designated agent of the recipient of such information, you are
hereby notified that any use, dissemination, copying or retention of this
email or the information contained herein is strictly prohibited and may
subject you to penalties under federal and/or state law. If you received
this email in error, please notify the sender immediately and permanently
delete this email. Thank You

WalzCraft PO Box 1748 La Crosse, WI, 54602-1748
www.walzcraft.com<http://www.walzcraft.com> Phone: 1-800-237-1326
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com


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.