Each value Oracle database uses must have a datatype specified, whether the element is a column in a table or an argument or a variable in a program code. A data type is either scalar or non-scalar. A scalar type contains an atomic value, for instance Salary is 3000. A non-scalar datatype contains a set of values, for instance PostalCode collection. A datatype defines the domain of the element and how Oracle will treat that element. For instance the datatype for Salary (NUMBER(6,2)) defines that the salary is numeric and it can only contain numeric information. A datatype can be one of these categories:

  • Oracle build-in datatype
  • ANSI, DB2, and SQL/DS Data Types
  • User-Defined Types
  • Oracle-Supplied Types

Oracle build-in datatypes are of type character, numeric, long/long raw, datetime, large object (LOB) and rowid. When creating tables also ANSI, DB2, and SQL/DS Data Types can be used. Both DB2 and SQL/DS are products from IBM. Oracle recognizes the ANSI or IBM data type by its name and converts the data type to the equivalent Oracle data type. User-defined types are datatypes users can define themselves using the tools Oracle provides for this. The Oracle-supplied types are user-defined types that Oracle has defined using the same tools we can use for defining user-defined types. Oracle-supplied types are:

  • Any Types
  • XML Types
  • URI Types
  • Spatial Types
  • Media Types

 

Cheers,

Heli