1. General insert operation.
Use syntax insert INTO table_name[(Column[,column ...])] VALUES (Value[,value ...]) Insert statement, each insert can only be inserted into one of the specified data in the target table. If there are many rows that need to be inserted, and the data is extracted from other tables or tables, this does not satisfy the requirement. So Oracle provides an extension, as described below.
2.insert into table_name[(Column[,column ...]) select_statement
Oracle provides an extension that inserts records queried through a SELECT statement into all columns or columns in the specified table. can only be inserted into one table at a time, but performance is higher than writing many insert statements. In addition, Oracle also provides direct CREATE TABLE table_name as SELECT .... (as can not be less!) ), the implementation directly creates the table and inserts the data, depending on the result of the subsequent SELECT statement, such as copying only the table structure, the constraint is not assigned value, then you can use the CREATE TABLE new_table as SELECT * from source_table where 1=0; --1=0 does not query records, only the basic structure is copied.
For example, there is a need: Table mxt new Column time, then this new column in Oracle will be placed behind all columns, now want to put this time column in the 2nd position, then you can use this action:
The following is a detailed description of Oracle's additional extensions to the insert operation, achieving the goal, an insert operation, inserting into multiple tables, and inserting multiple records into each table.
3 Insert to multiple targets
There are four types of these:
1. Unconditional Insert
2. Insert all with a condition
3. Insert first with a condition
4. Pivoting insert
Multiple table Insert Usage restrictions:
1. You can use multiple table inserts only on table, not on views or materialized view.
2. This insert operation cannot be performed on the remote table.
3. In a multi-table insert operation, you cannot specify a table's set expression.
4. The Into target table in a multi-table insert cannot have more than 999 columns.
Oracle Insert multiple rows (RPM)