Forum OpenACS Q&A: Implicit vs. Explicit cursors

Collapse
Posted by Daryl Biberdorf on

Steven Feuerstein, the author of numerous PL/SQL books (the Ants book, for one, as well as his PL/SQL Best Practices book) from O'Reilly, heavily advocates explicit cursors for maintainability reasons. Most of the cursors I've written are for queries that are a bit more than the trivial ones Tom Kyte usually shows in his examples. For such queries, I find the code to be more readable if the query is relocated to a declared cursor in the package/procedure header, with a cursor name that really gives one an idea of what's being returned. This is especially so with a parameterized cursor. I don't really want to have to create views for each of these.

However, Tom Kyte makes some valuable points, so I'm sure I'll be re-evaluating Feuerstein's recommendations in light of Kyte's arguments.