admin 管理员组

文章数量: 1087139


2024年4月15日发(作者:vab常用代码)

Oracle之PLSQL的变量小结

Variable summary of PL/SQL's Oracle

There are four types of PLSQL variables, namely:

Scalar type (Scalar)

-composite type (Composite)

-reference type (Reference)

LOB type (Large Object)

1 scalar type:

-a variable that holds only a single value

-when defining, you must specify scalar data types

1.1 commonly used scalar types

(1)VARCHAR2 (n);

Defines strings of variable length

N specifies the maximum length of the string

The maximum value of n is 32767 bytes

The length must be specified when using

When the PLSQL block uses this data type to manipulate the VARCHAR2 table

column, the value should be no more than 4000 bytes long

(2)CHAR (n):

Defines a fixed length string

N specifies the maximum length of a string

The maximum value of n is 32767 per se

Specifies the length when used. If not specified, the default value is 1

When the PLSQL block uses this data type to manipulate the CHAR2 table column, the

value should be no more than 2000 bytes long

(3)NUMBER (P, s);

Defines integer and floating-point numbers of fixed length

P represents precision, used to specify the total number of digits

S represents the scale used to specify the number of digits after the decimal point

(4)DATE

Define date and data data

(5)BOOLEAN

Define Boolean variables


本文标签: 作者 小结 代码 变量