You can create PL/SQL datatypes in the declaration portions of procedures, functions, root anonymous blocks, package bodies, and package specs.
You create SQL types by using a DDL operation with the following syntax:
type newType is definitionOfTheType;
The basic syntax is shown here:
declare type newType is definitionOfTheType;