1 Basic data types
1) The numeric type number numbers can be formatted numerically by P,s. p denotes precision, which refers to the number of all valid digits in a numeric value. The parameter S represents the scale range, which represents the number of decimal places to the right.
such as Num_money number (9,2);
2) character type varchar2,char,long,nchar,nvarchar2 and so on. The VARCHAR2 is used to store variable-length strings. The maximum length is 4000 bytes. The char type represents a string of the specified length. char (maxlength)
MaxLength represents the maximum length of characters that can be stored. The default maximum length for a char type is 1 bytes. A long type represents a mutable string.
3) The date type has only a single date type. Storage space is 7 bytes of storage century, year, month, day, hour, minute, second
4) Boolean type its variable value can be true,false, or null.
2 Special data types
The 1%type type can declare a data type that is the same as the specified column name. For example declare Var_job emp.job%type; The data type of the emp.job is varchar (20), so the data type of var_job is also varchar (20), and the benefit is 1 you do not have to look at the data types of the columns in the table to ensure that the variables you define can store the retrieved data. 2 If you modify the data types that are already in the table, you do not have to consider type changes to the defined variables. Variables of type%type are automatically adjusted according to the actual type of the column.
Data types in Oracle