The INSERT statement in Oracle is used to insert new rows into the table. The syntax is: INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...), where table_name is the table Name, column1, column2, ... are column names, value1, value2, ... are values. Multiple rows can be inserted. NULL values must be inserted. The values must be compatible with the data type. Repeated primary key values cannot be inserted, which will trigger The defined trigger, if no column name is specified, will be inserted in table column order.
INSERT statement in Oracle
In Oracle database, INSERT statement is used to insert new rows in the table .
Syntax
<code>INSERT INTO table_name (column1, column2, ...) VALUES (value1, value2, ...);</code>
Parameters
Example
Insert the following rows into the employees table:
<code>INSERT INTO employees (employee_id, first_name, last_name) VALUES (100, 'John', 'Smith');</code>
Insert multiple rows
To use the INSERT statement to insert multiple rows, you can use multiple VALUES clauses, as shown below:
<code>INSERT INTO employees (employee_id, first_name, last_name) VALUES (100, 'John', 'Smith'), (101, 'Jane', 'Doe'), (102, 'Peter', 'Parker');</code>
Insert NULL values
To insert NULL values, you can use NULL keyword, as shown below:
<code>INSERT INTO employees (employee_id, first_name, last_name) VALUES (100, 'John', NULL);</code>
Note
The above is the detailed content of How to use insert in oracle. For more information, please follow other related articles on the PHP Chinese website!