Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Advantage of explicite over implicite cursor

Status
Not open for further replies.

parbhani

Technical User
Jul 3, 2002
125
GB
Hi all,

Just a question about the implicit and explicit cursors.
Its recommended in many books and documents that in PL/SQL one should use explicit cursors, ALWAYS, even if you know that the cursor will be returning( or will be used to return ) only one row.
What is the exact difference that will make ?
Please guide.

Regards
 
In fact select into may perform 2 fetches: 1 to get a row and another one to verify it's the only row satisfying conditions. Even if you know that second fetch is redundant :) So explicit cursor provides more control over execution and may improve performance.

Regards, Dima
 
Actually, if anything, implicit cursors will tend to be faster, though this difference is likely to be miniscule. Tom Kyte has a couple of discussions on this


It's far more important is that you use the convention that will tend to make the most readable code. To me, that's implicit cursors, though there are other people that disagree.

Justin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top