|
Sorry, it's V5R3, Luis. :(
Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"Some see the problem in every opportunity, some see the opportunity in
every problem."
-- Kevin Cowling
Dennis,
Which release is your system on?
Since V5R4 there exists the option of doing recursive SELECTs. Maybe
this
could used in solving your problem
Regards,
Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries
On Wed, Jun 16, 2010 at 12:19 PM, Dennis Lovelady
<iseries@xxxxxxxxxxxx>wrote:
Thanks, Alan:following
The problem with that is that it masks the fact that the data are not
processed in the prescribed sequence. Apparently you've not been
this thread (no problem there), but it's critical that the rows bethat
*processed* in a particular sequence, rather than just *presented*
way.for
Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
I no longer need to punish, deceive or compromise myself. Unless, of
course,
I want to stay employed.
Hi Dennis
Try this
with t1 as (
select dept, name
from names
group by dept, name
)
select dept, name from t1
order by dept, name
Alan Shore
Programmer/Analyst, Direct Response
E:AShore@xxxxxxxx
P:(631) 200-5019
C:(631) 880-8640
"If you're going through Hell, keep going" - Winston Churchill
"Dennis Lovelady"
<iseries@lovelady
.com>
To
Sent by: "'Midrange Systems Technical
midrange-l-bounce Discussion'"
s@xxxxxxxxxxxx <midrange-l@xxxxxxxxxxxx>
cc
06/16/2010 12:18
Subject
PM RE: SQL row processing order
beUDF
Please respond to
Midrange Systems
Technical
Discussion
<midrange-l@midra
nge.com>
Dang it, I'm back to square 1 on this.
This simple select:
with t1 as (
select dept, name
from names
group by dept, name
order by dept, name
)
select dept, name from t1
Produced these results at V5R3:
S&C TEMPLETON
EXEC DALY
IS KING
STAFF NESSON
OPER PINA
OPER GYAMFI
IS GOLBA
Is there really no way to tell SQL the order in which rows are to
maintenanceprocessed?
Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"I knew I was an unwanted baby when I saw that my bath toys were a
toaster and a radio."
-- Joan Rivers
I used to think CASE tools were oh so cool. Then RPG actuallystarted
getting improvements. And the CASE tool vendors thought
bestmoney was reserved for paying off leveraged buy outs instead of
product improvements and they lagged behind, further and further,
until they fell into disuse.
Now I suppose SEQUEL is going that same route.
Rob Berendt
--
Group Dekko Services, LLC
Dept 01.073
Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com
From: "Dennis Lovelady" <iseries@xxxxxxxxxxxx>
To: "'Midrange Systems Technical Discussion'"
<midrange-l@xxxxxxxxxxxx>
Date: 06/16/2010 05:10 AM
Subject: RE: SQL row processing order for UDF
Sent by: midrange-l-bounces@xxxxxxxxxxxx
Thanks to all who responded. Rob's idea seems to fit the bill
product,in
this case.
Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"Our vision is to speed up time, eventually eliminating it."
-- Alex Schure
Create a view with that statement. Access the view with SEQUEL?
Rob Berendt
Dennisagainst
I didn't, but that's a very good idea.
However, it's not a complete solution since some uses of this,
my
fervent complaints, will be implemented using the SEQUEL
once.whichDon't
has
no support for the WITH statement (among many other things).
get--
me
started.
Any response to the "is it expected behavior" part?
Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
Time is nature's way of keeping everything from happening at
Bok)stars."
did you try to use an CTE?
With x as (Select TRNADAT, Amount
From MyTable
Where ...
Order By TRNDAT)
Select x.* MTD(Amount)
From x;
Mit freundlichen Grüßen / Best regards
Birgitta Hauser
"Shoot for the moon, even if you miss, you'll land among the
(Les
Brown)
"If you think education is expensive, try ignorance." (Derek
Dennistraining"What is worse than training your staff and losing them? Not
them
and keeping them!"
-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von
dateLovelady
Gesendet: Tuesday, 15. June 2010 15:30
An: 'Midrange Systems Technical Discussion'
Betreff: SQL row processing order for UDF
I created a UDF like a more complex version of this:
CREATE FUNCTION MTD(date, decimal(11,2)
RETURNS DECIMAL(13,2)
RETURNS NULL ON NULL INPUT
.
The select would like like:
SELECT TRNDATE, AMOUNT, MTD(AMOUNT)
ORDER BY TRNDATE
And ideally the result would be a running total of month-to-
functionvalues.
Pretty slick.
What I found, though, leads me to believe that the MTD
thatis
being called before the ORDER BY, and that's giving me wildly
incorrect results, even when the source table is already in
anysequence. When the source table is already in the correct
sequence and I drop the ORDER BY, I
*seem*to* get the results that I want, but I doubt there's
hardguarantee of that; besides, that's a requirement that'll be
aroundto meet. So my two-part
question is: Is this expected behavior? Is there a way
can'tthis?
Dennis E. Lovelady
AIM/Skype: delovelady MSN: fastcounter@xxxxxxxxxxxx
<http://www.linkedin.com/in/dennislovelady>
www.linkedin.com/in/dennislovelady -- "A fanatic is one who
pleasechange his mind and won't change the subject."mailing
- Winston Churchill
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting,
pleasetake a moment to review the archives atmailing
http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting,
pleasemailingtake a moment to review the archives at
http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting,
pleasetake a moment to review the archives atmailing
http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting,
subscribe,mailingtake a moment to review the archives at
http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To
takeunsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
subscribe,a moment to review the archives atmailing
http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To
takeunsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
mailinga moment to review the archives at
http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
take alist To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please
http://archive.midrange.com/midrange-l.moment to review the archives at
mailing list
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
To post a message email: MIDRANGE-L@xxxxxxxxxxxx--
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.
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.