Oracle PL/SQL constants/variables/scalar (to be improved)

Source: Internet
Author: User
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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.