DECLARE TYPE
Define data types for Oracle compatibility. This statement allows declaring PL/SQL-style record types and associative arrays, and REF CURSOR types within stored procedures.
Overview
DECLARE
TYPE type_name TABLE OF rec_type_name INDEX BY idx_type_nameAssociative Arrays
DECLARE
TYPE array_t IS TABLE OF VARCHAR2(64) INDEX BY PLS_INTEGER;
array array_t;
BEGIN
array(1) := 'Hello';
array(2) := 'World';
DBMS_OUTPUT.PUT_LINE(array(1));
END;Methods
Examples
Associative Array of Scalar Elements
Associative Array of Records
RECORD Types
Syntax
RECORD Types in Routine Parameters and Function RETURN
Using RECORDs in Routine Parameters
Using RECORDs as a Function Return Type
Requirement
REF CURSOR Types
Syntax
Weak REF CURSOR
Strong REF CURSOR
Supported RETURN Types
RETURN record_type
record_typeRETURN record_type%ROWTYPE
record_type%ROWTYPERETURN record_variable%TYPE
record_variable%TYPERETURN cursor%ROWTYPE
cursor%ROWTYPERETURN table_or_view%ROWTYPE
table_or_view%ROWTYPERETURN cursor_variable%ROWTYPE
cursor_variable%ROWTYPESee Also
Last updated
Was this helpful?

