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



No, you are not missing anything, I think.

Years ago I worked with one of the distribution partners for SEQUEL. *IF* I
remember right (and, of course, I could be mistaken), we were told once that
you could "pass" any valid iSeries SQL sentence using the CLI. Obviously,
that is not the case :-(

That said, I seem to have read somewhere that the latest versions of SEQUEL
have had a lot of changes (eg., it seems that they now can use SQE) so maybe
a support call could help.

Thinking it better, go with Rob's idea. That way you can have your statement
easily available from inside the IBM i...


Best Regards,

Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries


On Wed, Jun 16, 2010 at 8:59 AM, Dennis Lovelady <iseries@xxxxxxxxxxxx>wrote:

Hi, Luis:

Yes, the CLI is where we're working with this one. The issue here is that
the CLI doesn't support WITH. Or am I missing some underlying thing in
your
post?

Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"I would give my right arm to be ambidextrous."
-- Yogi Berra



Besides Rob's excellent suggestion, I seem to remember that SEQUEL had
a CLI
interface. Have you checked that?

Regards,

Luis Rodriguez
IBM Certified Systems Expert — eServer i5 iSeries


On Wed, Jun 16, 2010 at 4:35 AM, Dennis Lovelady
<iseries@xxxxxxxxxxxx>wrote:

Thanks to all who responded. Rob's idea seems to fit the bill best
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


Dennis
I didn't, but that's a very good idea.

However, it's not a complete solution since some uses of this,
against
my
fervent complaints, will be implemented using the SEQUEL product,
which
has
no support for the WITH statement (among many other things).
Don't
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 once.


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
stars."
(Les
Brown)
"If you think education is expensive, try ignorance." (Derek Bok)
"What is worse than training your staff and losing them? Not
training
them
and keeping them!"

-----Ursprüngliche Nachricht-----
Von: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] Im Auftrag von Dennis
Lovelady
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-date
values.
Pretty slick.



What I found, though, leads me to believe that the MTD function
is
being
called before the ORDER BY, and that's giving me wildly incorrect
results,
even when the source table is already in that sequence. 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 any
guarantee of
that; besides, that's a requirement that'll be hard to meet. So
my
two-part
question is: Is this expected behavior? Is there a way around
this?



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 can't change his mind and won't change the
subject."
- Winston Churchill



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


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


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


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