On Cursors, Context Switches, and Mistakes

http://www.oracle.com/technetwork/issue-archive/2015/15-jul/o45plsql-2543984.html

Key lessons learned:

  • Never use a cursor FOR loop to fetch a single row.
  • Never use an explicit cursor to fetch a single row.
  • Avoid writing code that hides bugs.
  • User-defined functions executed inside a SQL statement should never contain their own SQL statements.
  • Keep user interface and report formatting logic separate from data retrieval and business rule logic.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s