![]() Here ‘emp_tbl’ in the table which contains records of all the In the above example we are creating a cursor ‘emp_cur’ on a query which returns the records of all theĮmployees with salary greater than 5000. CLOSE the cursor in the Execution Section before you end the PL/SQL Block.ġ) Declaring a Cursor in the Declaration Section:ĭECLARE CURSOR emp_cur IS SELECT * FROM emp_tbl WHERE salary > 5000.FETCH the data from cursor into PL/SQL variables or records in the Execution Section.OPEN the cursor in the Execution Section.DECLARE the cursor in the declaration section.How to use Explicit Cursor? There are four steps in using an Explicit Cursor. select_statement – A select query which returns multiple rows.cursor_name – A suitable name for the cursor.General Syntax for creating a cursor is as given below: We can provide a suitable name for the cursor. ![]() ![]() It is created on a SELECT Statement which returns more than one row. An explicit cursor is defined in the declaration section of the PL/SQL Block.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |