The INTEGER data type in Oracle is used to store integers between -2,147,483,648 and 2,147,483,647. Mainly used to store integer identifiers, counters and status flags. It should be noted that this data type cannot store decimals or negative numbers, and the storage space is fixed.
Usage of INTEGER data type in Oracle
INTEGER is the data type used in Oracle to store integers. It can store integers between -2,147,483,648 and 2,147,483,647.
Syntax
<code>INTEGER [precision]</code>
Where:
precision
is optional, specifying the number of digits stored in INTEGER. Range is 1 to 38. Defaults to 32-bit if not specified. Usage
INTEGER data type is mainly used to store integers, for example:
Things to note
Example
<code class="sql">-- 创建一个名为 "customer_id" 的 INTEGER 列 CREATE TABLE customers ( customer_id INTEGER NOT NULL ); -- 插入一个数字到 "customer_id" 列 INSERT INTO customers (customer_id) VALUES (12345); -- 检索 "customer_id" 列中的数字 SELECT customer_id FROM customers;</code>
Output:
<code>12345</code>
The above is the detailed content of How to use integer in oracle. For more information, please follow other related articles on the PHP Chinese website!