DECLARE
TYPE last_name_typ IS VARRAY(3) OF VARCHAR2(64);
TYPE surname_typ IS VARRAY(3) OF VARCHAR2(64);
-- These first two variables have the same datatype.
group1 LAST_NAME_TYP := Last_name_typ('Jones','Wong','Marceau');
group2 LAST_NAME_TYP := Last_name_typ('Klein','Patsos','Singh');
-- This third variable has a similar declaration, but is not the same type.
group3 SURNAME_TYP := Surname_typ('Trevisi','Macleod','Marquez');
BEGIN
-- Allowed because they have the same datatype
group1 := group2;
-- Not allowed because they have different datatypes
-- group3 := group2; –– raises an error
END;
/
Datatype Compatibility for Collection Assignment
0 comments:
Post a Comment