|
Posted by Dimitri Furman on 02/01/06 06:32
On Jan 31 2006, 08:43 pm, "Doug" <drmiller100@hotmail.com> wrote in
news:1138758202.017630.195220@g44g2000cwa.googlegroups.com:
>>We are set based. And a set in a relational database is a collection of
>>rows with no implied order.
>
>>A cursor is not a set - it is an operation to turn a set into a series
>>of rows, with implied order.
>
> A cursor does NOT require an order. Further, a cursor does NOT require
> an implied order. I believe we agree on the above two statements?
>
> If so, then perhaps another description of a cursor might be "an
> operation or contstruct that allows the traversing of a set." You use
> a cursor when you need to conduct complex logic on each member of a
> set. Normally, you start at one end, examine and perform logic on each
> member. Then, you proceed to the next member.
>
> The very first member can be thought of as the "first." You might then
> proceed to the "next." You usually end up with the "last."
As long as you are talking about "first", "next", and "last", some order
must exist by definition. That may not be an order that you define (with
the ORDER BY clause), but a cursor must have some internal order in order
to work (forgive the pun). When you declare a cursor, you turn a set into
an ordered list of rows, giving meaning to "first", "next", and "last".
Now, if you are saying that no ORDER BY clause is required when declaring a
cursor, I don't think anyone would argue with that. An order would still
exist, you just won't know what it is.
--
remove a 9 to reply by email
[Back to original message]
|