-
cursor VS select stmt
A table has a id column as primary key. Which of the following is the best way to select from that table using id column?
1. Select stmt with a where clause on id column
2. Cursor with select stmt with a where clause on id column
I know for the first I need to catch WHEN NO_DATA_FOUND exception.
For performanance reasons which one is better a cursor or a stand alone select stmt with no_data_found exception. Can someone please advise.
Thanks,
-
Do you mean an explicit cursor? As a rule I'd just do whichever is the most simple to write and understand ... for that reason I'd rule out explicit cursors and just do the select, and catch the exception.
-
A simple SELECT is always faster than a cursor, except when it's not.
Jeff Hunter
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|