"Orchid XP v7" <voi### [at] dev null> wrote in message
news:47b1fefc$1@news.povray.org...
>
> Just being curios... What's a 'cursor', and why is that bad?
To quote a friend on SQL central. Cursors are RBAR (Row by agonising row)
processing
SQL's a set-based language. It's supposed to process datasets, not
individual rows. Here's a cursor syntax in T-SQL. My oracle's way too rusty
for me to attempt to do the same in pl-sql.
DECLARE curSomething CURSOR FOR
SELECT somecolumn FROM SomeTable
FETCH NEXT FROM curSomething INTO @AVariable
WHILE @@FETCH_STATUS = 0 -- there are rows in the cursor
BEGIN
-- Do something with the variable @AVariable
FETCH NEXT FROM curSomething INTO @AVariable
END
Post a reply to this message
|