Handling Variables

Submitted by:Andery Smith

Date added:30 January, 2012

Category:PL SQL

The following code block illustrates the use of TYPE..IS... and VARRAY. In this sample, a type v_arr is defined as an variable array of maximum 25 elements which are of type NUMBER(3). Then a variable v1 is defined as type v_arr . This sample code also demonstrates the use of %TYPE attribute.

Tags: handling variables

Code Snippet:

    DECLARE

TYPE v_arr IS VARRAY(25) of NUMBER(3);
v1 v_arr;
v_empno employee.empno%TYPE;

BEGIN

v1(2) := 3;
DBMS_OUTPUT.PUT_LINE('The Value of v1(2) = ' || v1(2));
v_empno := 4;

END;
 
 

Comments