How Oracle custom type

A: There are many types of Oracle, it can be divided into the following categories:
a string type. Such as: char, nchar, varchar2, nvarchar2 .
2, numerical type. Such as: int, number (p, s ), integer, smallint.
3, the date type. Such as: date, interval, timestamp.
4, PL / SQL type. Such as: pls_integer, binary_integer, binary_double (10g ), binary_float (10g), boolean. plsql type can not be used in the sql environment, such as when construction of the table.
5, custom types: type / create type.

Two: type / create type distinction contact
1, the same:
(1) Create key type can be used with or directly define the type defined type
2, the difference:
Create type Syntax:
Create type variable as table of type
or:
Create type variable as object (
     field type 1 1,
     field 2 type 2
);

type Syntax:
type is table of variable type
or:
type variable is record (
     Field Type 1 1,
     Field 2 Type 2
);

Differences:
(1) create a later as, if directly behind the type with IS
(2) create Object is created, and a record type Record.
(. 3) of the type used in a statement block, and create a separate.

Description: Custom generally of two types, object type and table type. recored a similar object, may represent a row of data table, and the object field is quite field in the table, the type of custom table need good object types have been defined.

 

Specific Reference: https://www.cnblogs.com/advocate/p/3729998.html

Guess you like

Origin www.cnblogs.com/shujk/p/12547836.html