| September 09, 2009 14:39:45 |
#3 |
| promisinganuj |
Member Since: September 2009 Total Comments: 3 |
RE: Explicit cursor and Select into statement |
When a cursor name is explicitly assigned to a SELECT statement through CURSOR statement, it is called an explicit cursor. Explicit cursors are generally used to work with more than one row within PL/SQL. It has got the following attributes: 1. Defining the Cursor 2. Opening the Cursor 3. Fetching rows(values) from Cursor (one at a time) 4. Closing the Cursor
SELECT into statement allows you to retrives the query result in user defined variables. But the limitation here is that the query must return a single row. Its a best practice to handle NO_DATA_FOUND and TOO_MANY_ROWS exception when dealing with "SELECT INTO" statement. |
| |