-- subtypes.sql

DECLARE
   SUBTYPE sentence_type IS VARCHAR2(1000);
   SUBTYPE word_type IS CHAR(10);
   description sentence_type;
   word word_type;
BEGIN
   description := 'Flower Pot';  --10 bytes long
   word := description;          --description and word are in same
                                 --datatype family.
   description := 'Baseball Glove';
   word := description;          --description now exceeds 10 bytes, so
                                 --Oracle throws a VALUE_ERROR exception.
END;
/
