Chapter 15 DBMS-Specific Features
In application development, a cursor is a multi-row query.
In Oracle, a cursor lets you name a work area and access its stored information.
Cursors have the following properties:
Property | Description |
---|---|
Name | The name of the item which should be clear and meaningful, and should convey the item's purpose to non-technical users. |
Code | The technical name of the item used for generating code or scripts, which may be abbreviated, and should not generally include spaces. |
Comment | Additional information about the cursor. |
DB Package | Name of the database package to which the cursor belongs. |
Return Data Type | Allows you to define the data type of a cursor result value. |
Public | Allows you to declare the cursor in the package specification and to permit use from outside the database package. A private cursor (check box deselected) is only defined in the package body. |
The Parameters tab lets you define the input values for cursors.
For example, you can define a parameter "num" and use it in the cursor to define the cursor input value. See example below.
The Definition tab lets you define the cursor. You can use operators and functions to insert script items into the cursor definition.
For example, the following cursor allows locating in table emp, the employee number, name, and function in a given department and for a given employee number:
Copyright (C) 2007. Sybase Inc. All rights reserved. |
![]() |