Thread: FOR vs Cursors

FOR vs Cursors

From
"Van Ingen, Lane"
Date:
After reading the manual (8.0). I am not certain what real advantage there is to using a cursor
over using a FOR loop. since FOR automatically uses a cursor anyway. They both avoid 
memory problems. Have I missed something or are there other reasons?

Re: FOR vs Cursors

From
"Sim Zacks"
Date:
One advantage of a cursor over a for loop is that it makes your code more
portable.
It also allows you to bring existing code over without having to majorly
rewrite.

""Van Ingen, Lane"" <lvaningen@ESNCC.com> wrote in message
news:A3FF4275060B76459B5C08A64AE330C86A37@twmail.esncc.com...
> After reading the manual (8.0). I am not certain what real advantage there
is to using a cursor
> over using a FOR loop. since FOR automatically uses a cursor anyway. They
both avoid
> memory problems. Have I missed something or are there other reasons?
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: you can get off all lists at once with the unregister command
>     (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)
>