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



Well, if you insist:

From: Michael_Schutte@xxxxxxxxxxxx

What do you mean? the program I pulled it from has been in use since
1998.
Page Up/Page Down works properly even after end of cursor is reached.

The fetch relative is only executed when the page up is pressed... on
a page down, a regular fetch is executed without positioning.

If you initially created the cursor with a "position to" (in SQL terms, a
WHERE clause such as WHERE NAME >= "G"), and then immediately try to roll
back >(to get the last page of names starting with "F") you cannot use the
RELATIVE technique.

If your cursor contains ALL the records in the file, then you can certainly
roll through them, but typically the user wants to position to a starting
key value, which requires the WHERE clause above (which corresponds to a
SETLL in RPG). Once you've done that, there's no way to use that cursor to
get >previous records.

Joe


And to be fair the question I posted was:

Not to be argumentive either, but are you saying that DB/2 on a 400 doesn't
support scrollable cursors? I would be rather surprised to find that is
true.

And scrollable cursors allow you to position either by sequence or by
reference.

Which was tied to a later message in the exchange and could have been
confusing.
(I tend to read through them all before I post or ask a question.)


So basically, what to me looked like and was intended as a question could
have looked to you like some kind of snarly answer.
But here is my take- having been in the electronic communications game now
since they opened my Arpanet account a very
long time ago - it is easy to misinterpret the context and tone of what
someone is saying, especially if anyone is the
least bit careless in how they phrase or reference something. (I am a bit
guilty of that here, since the question I put out
was sort of tangential to the conversation.) Still- it *was* just a
question, one I figured you would know right off the
top of your head without the need to go look it up. Same as I could do had
that been a reference to Mainframe DB/2.

It takes a lot of effort to "listen" to what is written electronically, and
one must develop the habit of thinking
through what they think they heard.

By the way, in the quoted original message above, you could simply ensure
the cursor is ordered, look at the number of records
retrieved, and then perform a fairly efficient binary search - which is
something *I* tend to do when I have that particular
problem. They can be coded to operate very fast on results up to a few
hundred thousand records. Then again, I would
probably just use files to do this on the 400. <shrug>




-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-
bounces@xxxxxxxxxxxx] On Behalf Of Joe Pluta
Sent: Saturday, October 13, 2007 11:42 AM
To: 'RPG programming on the AS400 / iSeries'
Subject: RE: SETLL in SQL ?

From: Paul Raulerson

Or you can design the application differently. Or use two queries, or
table up the starting records of
interest, or... any of a lot of different techniques. This is pretty
much
a strawman argument, because
it is an argument built only to prove your point... <grin>

Gotta call bull**** on this, Paul. I'm not trying to prove anything,
only
giving a real world example of something I do all the time, every day,
that
requires positioning by key within an already-created view. You want
to
call it a strawman, that's fine, but you're misusing the term and
avoiding
the issue.


Anyway, this part of the thread has devolved from how to do
something
(fact)
to whether you think it's silly (opinion), and at that point there
are
diminishing returns.

That's mostly because you have a bit of attitude if anyone appears to
be
challenging you, even when they are not. Read what I wrote - I really
did
just ask you a question. You layered on the attitude mate. ;)

<laughing> *I* have attitude?!?!!? Oh, golly, please read the thread
and
see who uses words like "silly" to describe the other person's opinion.
Or
who told who to "go read up". Paul, I daresay you are one of the few
people
on the list whose attitude meter can match mine. <grin>


What I asked was if the 400 supported scrollable cursors - which once
I
spent the 20 minutes to dig in the docs, it does.

You didn't actually ask, you said "are you saying that..." which
typically
denotes more of a rhetorical question. More importantly I didn't find
it
necessary to answer it since scrollable cursors do not allow you to
position
by key, which was the only point I initially made. I never said you
couldn't move backwards, and again, I ask you to find the post where I
said
that, since it's the basis of your entire argument.

To quote me: "You cannot position a cursor by key. This is true in all
dialects of SQL."


Scrollable cursors offer several possible
solutions to the problem that you appear to have not considered.

Actually, I considered all of the options if you read my posts,
including
what I consider the best solution, which is Walden's dual-cursor
approach,
although it is still, in my opinion, not as good as a simple ISAM key.

And by the way, the phrase "you appear to not have considered" is not
only
simply wrong factually, it is in my opinion dripping with attitude
because
it has lots of implied negative judgment in it. Maybe you don't see it
that
way, and it's simply our different uses of the English language that
are
putting us a bit at odds.


Well, see, we agree after all. :)

As is usually the case when you get down to the hard facts.

Yup.

And let me reiterate the FACT:

"You cannot position a cursor by key. This is true in all dialects of
SQL."

Is this correct or not?

It it's incorrect, I apologize, if it's correct, well, I'll let you
decide
whether you want to do the civil thing.

Joe

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