|
-
Here is an example with an implicit cursor (I had to look up the syntax because I almost always use explicit cursors):
DECLARE
somevariable scott.emp%ROWTYPE;
BEGIN
SELECT *
INTO somevariable
FROM scott.emp
WHERE empno = 1891;
DBMS_OUTPUT.put_line (somevariable.empno || ', ' || somevariable.ename);
END;
/
The implicit cursor can deal with only with queries that return a single row.
If I recall correctly, implicit cursors require two calls to the database -- one to check to see if only one row will be returned, and one to actually get the row. So I am reluctant to use them because this seems awfully inefficient. But maybe someone knows whether implicit cursors really do have a performance disadvantage over explicit cursors.
CliffW
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
|