Re: Learning Cursors
- From: "PHernandez" <phph109@xxxxxxxx>
- Date: 23 Feb 2006 08:03:30 -0800
Jim Kennedy ha escrito:
"PHernandez" <phph109@xxxxxxxx> wrote in message
news:1140705075.095896.244040@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Mark D Powell ha escrito:Yes, how else would you get the information?
Every SQL statement is a cursor. I take you are really talking about
explicit cursors and cursor for loops.
A cursor may be necessary when you need to process each row in a result
set individually in your logic. Generally speaking the logic needs to
be complex and not easily solved within a single query. Otherwise you
should code the single query. The presence of bad data or error
conditions that need to be dealt with on an individual basis while the
remander of the data is processes might be a reason to use a cursor.
I have a follow up question on this, if I have a query that returns > 1
row and I'd want to display the result in a gui of some sort, e.g. a
web-page- I'm pretty much stuck with a cursor, right? Or are there
other ways to do it?
--ph
Oracle 10g
Hey, that's my question!!
To extend it a little. Many times all I do with a cursor is to loop the
result and more or less concatenate the rows to a string. e.g:
"<person><name>Patrick</name><lname>Green</lname></person><person> ....
"
Since it's kind of a trivial task and no doubt very common, I thought
that Oracle maybe provide some kind of magic to do it without looping a
cursor.
--ph
.
- Follow-Ups:
- Re: Learning Cursors
- From: DA Morgan
- Re: Learning Cursors
- References:
- Learning Cursors
- From: G P
- Re: Learning Cursors
- From: Mark D Powell
- Re: Learning Cursors
- From: PHernandez
- Re: Learning Cursors
- From: Jim Kennedy
- Learning Cursors
- Prev by Date: Unable to connect through application
- Next by Date: Oracle Performance Questions
- Previous by thread: Re: Learning Cursors
- Next by thread: Re: Learning Cursors
- Index(es):
Relevant Pages
|