A constant
The definition of a constant must include the keyword constant.
Example: zero_value constant number: = 0;
2 variables
2.1) Declare Variables
Variable_name [constant] databyte [not null] [: = | default expression];
Example: V1 varchar2 (25 );
2.2) assign values to variables
Two methods are available.
1. assign values to variables directly
Example: V1: = 'jack ';
2. assign values to variables through SQL select into or fetch
For example:
Select name into V1 from customer where id = 10;
Scalar)
I. Digital
| Datatype |
Range |
Subtypes |
Description |
| Binary_integer |
-214748 to 2147483647 |
Natural Natural Npositive Positiven Signtype |
Used to store single-byte integers. The storage length must be less than the number value. Subtype used to limit the range ): Natural: used for non-negative numbers, and null Positive: used for positive numbers and null Natura1n: used only for non-negative values, not for null values Positiven: used only for positive numbers, not for null values Signtype: only values:-1, 0, or 1. |
| Number |
|
|
|
|
|
|
|
Ii. Balanced type
| Datatype |
Range |
Subtypes |
Description |
| Char |
Maximum length: 32767 bytes |
Character |
Stores fixed-length strings. If the length is not determined, the default value is 1. |
| Long |
Maximum length: 2147483647 bytes |
|
Store variable-length strings |
| Raw |
Maximum length: 32767 bytes |
|
|
| Longraw |
Maximum length: 2147483647 bytes |
|
|
| Rowid |
18 bytes |
|
|
| Varchar2 |
Maximum length: 32767 bytes |
|
|
Iii. Date and Boolean
References
Http://www.qqread.com/oracle/b412122105_2.html