Chapter 12 DBMS-Specific Features
A package procedure is created in a database package. If you delete the database package you also delete the procedures it contains.
A package procedure has 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 package procedure. |
| Stereotype | Sub-classification used to extend the semantics of an object without changing its structure; it can be predefined or user-defined. |
| DB Package | Name of the database package to which the procedure belongs. |
| Type | Allows you to choose between procedure and function. |
| Return data type | Allows you to define the return data type of a function. |
| Pragma | Allows you to type a compiler directive, that is, a string for specifying compilation parameters for the procedure. |
| Public | Allows you to declare the procedure in the package specification and to permit use from outside the database package. A private procedure (check box deselected) is only defined in the package body. |
The following tabs are also available:
For example, the definition of the CREDIT package procedure is the following:
CREATE PROCEDURE credit (Account_number NUMBER, Amount IN NUMBER) AS BEGIN UPDATE accounts SET balance = balance + amount WHERE account_id = acc_no; END;
| Copyright (C) 2008. Sybase Inc. All rights reserved. |
| |