RECORD types and associative arrays, the user-defined types provided for use with stored procedures, make it possible to organize data into logical units for processing.
They can also be used as parameters or return values when stored procedures and functions call other stored procedures and functions.
Note however that values that have user-defined types cannot be passed to clients.
RECORD is user-defined datatypes consisting a set of columns.
A user can process a variety of data respectively in a logical units.
As processing a variety of data including name, payroll, department in a single form of "employee", it can be handled as a single record type.
To declare a record datatype, A user need to refer to the contents in the DECLARE TYPE section.
Basic usages of the rest are the same as one in the DECLARE TYPE section except %ROWTYPE.TYPE type_name IS RECORD (col_name datatype , …);
An associative array, INTEGER OR VARCHAR data type is used as an identifier to access an element of an array, is similar to the hash table.
It can be used to combine data items of the same type into a single data item for processing, regardless of the amount of data.
For instance, When processing "employees" data ranged from 1 to 100, An associative array can hold up to 100 data.
To declare an associative array, we recommend you to refer to the declare type section in a manual.
To access an array element, use a square branket as below.
예) V1[ 1 ] := 1; TYPE type_name IS TABLE OF datatype INDEX BY INTEGER|VARCHAR(size);
h3. TYPE type_name IS TABLE OF datatype INDEX BY INTEGER\|VARCHAR(size)
A Cursor Variables are the variables for processing the dynamic SQL statements which retrieving multiple records.
This cursor variables is even more flexible than cursor(explicit cursor) since it is not subordinate to a certain SQL statement.
It can be passed as parameters between the stored procedures, and delivers value to the client.
It is different with explicit cursor in that a ref cursor refers to another statement even when cursor is open, but explicit cursor only refers to the same statement all the time.TYPE type_name IS REF CURSOR;
h3. TYPE type_name IS REF CURSOR