Saturday, April 6, 2013

Declaring Collections with %TYPE

Declaring Collections with %TYPE
DECLARE
   TYPE few_depts IS VARRAY(10) OF VARCHAR2(30);
   TYPE many_depts IS VARRAY(100) OF VARCHAR2(64);
   some_depts few_depts;
-- If we change the type of some_depts from few_depts to many_depts,
-- local_depts and global_depts will use the same type 
-- when this block is recompiled
   local_depts some_depts%TYPE;
   global_depts some_depts%TYPE;
BEGIN
   NULL;
END;
/

No comments:

Post a Comment

Command to do active duplicate for Oracle Database

1. First login to target server 2. Validate tns connectivity between Source DB and Target DB 3. Prepare and validate space availability 4. S...