|
Pictures are transferred by the list.
Best choice, include the SQL statement, otherwise if you must send a pic,
you'll have to upload it to an image service (imgur.com) and post a link.
Charles
On Tue, Jul 28, 2020 at 10:32 AM Maria Lucia Stoppa <mlstoppa@xxxxxxxxx>
wrote:
@Charles
Yes, I am using offset and fetch first, as you can see in the picture of
my
last answer to you.
Il giorno mar 28 lug 2020 alle ore 18:16 Charles Wilt <
charles.wilt@xxxxxxxxx> ha scritto:
Are you LIMITing the cursor to 50 rows?make
If you're using LIMIT/OFFEST or FETCH FIRST in the cursor, that would
sense.should
Charles
On Tue, Jul 28, 2020 at 9:40 AM Maria Lucia Stoppa <mlstoppa@xxxxxxxxx>
wrote:
@Charles
I did it, but it doesn't work.
[image: image.png]
wTotalRows equals to 50 which is wRowsToRead instead of 994, as it
mlstoppa@xxxxxxxxxbe.there's
Il giorno mar 28 lug 2020 alle ore 16:21 Charles Wilt <
charles.wilt@xxxxxxxxx> ha scritto:
Again, use the GET DIAGNOSTICS after the OPEN, not the FETCH.
The grouping stuff is in 7.2, some of the OLAP functions are, but
been a bunch added.
Charles
On Tue, Jul 28, 2020 at 8:11 AM Maria Lucia Stoppa <
not
wrote:
@Charles
I've just tried and it returns the number of fetched rows only,
thecaused
existtotal result set length.
I'll take a look at those new features you suggested, hoping they
runatmlstoppa@xxxxxxxxx
V7R2 also.
Il giorno mar 28 lug 2020 alle ore 15:58 Charles Wilt <
charles.wilt@xxxxxxxxx> ha scritto:
On Tue, Jul 28, 2020 at 3:17 AM Maria Lucia Stoppa <
wrote:
Everything works fine, except the same static SQL statement is
atthe
least
twice to know the total number of rows (a simple count(*)) and
rows
themselves page by page.
GET DIAGNOSTIC DB2_NUMBER_ROWS is what you want to look at here.
If the previous SQL statement was an OPEN or a FETCH which
therows in
size of the result table to be known, returns the number of
nextthe
result
table. For SENSITIVE cursors, this value can be thought of as an
approximation since rows inserted and deleted will affect the
differentselectretrieval of
this value. Otherwise, the value zero is returned.
Run it after you OPEN your cursor, before you FETCH.
Now, on the same data retrieved by this SQL statement, others
statements must be run to get some totals according to
CUBEfinalgroup
by
clauses in order to present the data set distribution to the
user.
Have you looked at the OLAP functions in addition to ROLLUP,
andhttps://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/db2/rbafzolapexp.htm
grouping sets?
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/db2/rbafzgroupbyclause.htm
required an
When I started writing SQL on the AS/400, (sub)totaling
subscriptionextra
statement.
That is no longer the case.
Charles
--
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
affiliateaffiliaterelatedaffiliate
questions.
Help support midrange.com by shopping at amazon.com with our
relatedlink: https://amazon.midrange.com
--
Maria Lucia Stoppa
mlstoppa@xxxxxxxxx
--
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
questions.
Help support midrange.com by shopping at amazon.com with our
relatedlink: 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
questions.
Help support midrange.com by shopping at amazon.com with our
relatedlink: https://amazon.midrange.com
--
Maria Lucia Stoppa
mlstoppa@xxxxxxxxx
--
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
affiliatequestions.
Help support midrange.com by shopping at amazon.com with our
relatedlink: 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
questions.
Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.midrange.com
--
Maria Lucia Stoppa
mlstoppa@xxxxxxxxx
--
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 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.