|
| ||||||||||
| Tags: begin section, cursor, end section, for loop |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Cursor in oracle database
I have taken an option in the oracle database course the DBA option. This option is not so related to developing application.The DBA is not responsible for these thing it's the task of development team.But I need to know few things about the CURSOR concept in oracle database.At some points, The DBA also need to know but not necessary. So please let me know about the cursor in database. Thanks. |
|
#2
| ||||
| ||||
| Cursor in oracle database Cursor in oracle database : To execute the SQL statement,some reserve area is allocated .The PL/SQL allows you for naming. A cursor in the context area acts as a handle or pointer. The PL/SQL program are designed to control over the context area using Cursor. Cursor shows a structure in the memory and is slightly unique from cursor variable. During the creation and declaration of a cursor,a pointer variable is assigned to you,which doesn't point for any object.When the cursor is being opened the memory is assigned and the cursor structure is created.Then after cursor variable points to the cursor. |
|
#3
| ||||
| ||||
| Implicit cursors in oracle database The implicit cursors : The declaration of implicit cursors performed during SQL queries returning single row from the PL/SQL block.The implicit cursors are constructed through the simple SELECT statements which resides between the BEGIN and END section of PL/SQL Block.It is easy to perform the code. The cursor are capable to retrieve exactly one row at a time.The commonly occurred exceptions regarding the implicit cursor areNO_DATA_FOUND or TOO_MANY_ROWS. The syntax would be as follows : Code: SQL> SELECT emp_name, salary INTO Enm, Esal FROM EMP WHERE EMPNO = 4439; Last edited by MindSpace : 11-02-2010 at 04:36 PM. |
|
#4
| ||||
| ||||
| Explicit Cursors in oracle database Explicit Cursors : The explicit cursor are used when a query capable to return more than one rows for a query.A set of rows is fetched by the query is treated as active set.The space occupied by the active set is dependent on search criteria defined by SELECT statement. The syntax would be as follows : CURSOR <cursor-name> IS <select statement> And the sample code to construct the Explicit Cursor would be as explained below: Code: DECLARE CURSOR e_cursor IS SELECT emp_name FROM EMPLOYEE; BEGIN ---- --- END;
__________________ The FIFA Manager 2009 PC Game |
|
#5
| ||||
| ||||
| Attributes of Explicit Cursor in oracle database Attributes of Explicit Cursor : The Cursor defined by the user has at least four attributes.There are some useful attributes are being used to define and investigating on cursor.The attributes are explained below :
__________________ Grand Theft Auto 4 PC Video Game |
|
#6
| ||||
| ||||
| Using Cursor For Loop in oracle database Using Cursor For Loop : It is being used to process multiple records. there are 2 benefits with this type of cursor. 1 - It implicitly declares a %ROWTYPE variable and implement it as LOOP index. 2- It performs the opening and closing automatically when records are being fetched and closes when fetching comes to complete. Code: SQL> Declare
Cursor cur1 IS select Emp_name,salary from EMP;
BEGIN
For emp_rec IN cur1
LOOP
DBMS_OUTPUT.PUT_LINE(emp_rec.emp_name||' ' ||emp_rec.salary);
END LOOP;
END; |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Cursor in oracle database" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Joins in oracle database | Adriana_andros | Software Development | 5 | 11-02-2010 07:53 PM |
| Subqueries in oracle database | Landan | Software Development | 4 | 09-02-2010 04:57 PM |
| Different processes in oracle database | Aileen_L | Software Development | 4 | 01-02-2010 03:38 PM |
| Packages in oracle database | Garlands | Software Development | 3 | 30-01-2010 01:55 PM |
| Oracle Announces TimesTen In-Memory Database 11g and In-Memory Database Cache 11g | prakashseth | Web News & Trends | 1 | 30-07-2009 04:58 PM |