POV-Ray : Newsgroups : povray.off-topic : The Daily WTF [again] : Re: The Daily WTF [again] Server Time
21 Jul 2025 21:24:15 EDT (-0400)
  Re: The Daily WTF [again]  
From: Gail Shaw
Date: 12 Feb 2008 15:30:55
Message: <47b201ff@news.povray.org>
"Orchid XP v7" <voi### [at] devnull> 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

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.