Chapter 15 DBMS-Specific Features
Variables can be declared within a package. A variable can be used in a SQL or PL/SQL statement to capture or provide a value when one is needed.
For example, you can define the variable in_stock with a boolean data type to verify if a product is available or not.
Variables 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 variable. |
| DB Package | Name of the database package to which the variable belongs. |
| Data Type | Data type of the variable. You can use the Question Mark button to display the list of Standard Data Types. |
| Mandatory | If selected, indicates that the not null clause is set on the variable, thus making it mandatory. |
| Length | Allows you to define the variable length. |
| Precision | Number of places after the decimal point, for data values that can take a decimal point. |
| Default value | Default value of the variable. |
| Constant | Indicates that the variable is a constant. A constant has a value assigned. For example: Credit_Limit constant REAL := 500 000; |
| Public | Allows you to declare the variable in the package specification and to permit use from outside the database package. A private variable (check box deselected) is only defined in the package body. |
| Copyright (C) 2007. Sybase Inc. All rights reserved. |
| |