Composite Datatypes |
Introduction to Oracle
SQL & PL/SQL |
DECLARE |
DECLARE |
DECLARE |
record_name.field_name |
Identical record types can be assigned to each other directly.
DECLARE |
Note that a user defined record and a record anchored to a database table may have a compatible datatype, if they match in number, name, and datatype of fields. SInce they have compatible datatypes, the values can be directly assigned from one row to another.
DECLARE |
Creating a PL/SQL table is a two step process, first you declare the table type, and then declare an identifier using that type.
DECLARE |
You can assign and reference elements in a PL/SQL table using an integer to identify the specific row.
ename_table(1):='My name'; |
You can navigate a PL/SQL table with the following methods
table_name.EXISTS(n) |
table_name.COUNT |
table_name.FIRST / table_name.LAST |
table_name.PRIOR(n) |
table_name.NEXT(n) |
An example using some of the built in methods:
DECLARE |
You can create a PL/SQL table of records like so:
DECLARE |