I am a bit rusty on my cursor lingo in PL/SQL. Anyone know this?
An implicit cursor has attributes that return information about the most recently run SELECT or DML statement that is not associated with a named cursor. Note: You can use cursor attributes only in procedural statements, not in SQL statements.
The short answer is that implicit cursors are faster and result in much neater code so there are very few cases where you need to resort to explicit cursors.
PL/SQL has two types of cursors: implicit cursors and explicit cursors.
An implicit cursor is one created "automatically" for you by Oracle when you execute a query. It is simpler to code, but suffers from
Example
SELECT col INTO var FROM table WHERE something;
An explicit cursor is one you create yourself. It takes more code, but gives more control - for example, you can just open-fetch-close if you only want the first record and don't care if there are others.
Example
DECLARE CURSOR cur IS SELECT col FROM table WHERE something; BEGIN OPEN cur; FETCH cur INTO var; CLOSE cur; END;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With