expr1, expr2, expr_n : this specifies the values to assign to the columns in the table.
Oracle INSERT ALL Example
This example specifies how to insert multiple records in one table. Here we insert three rows into the "suppliers" table.
INSERT ALL
INTO suppliers (supplier_id, supplier_name) VALUES (20, 'Google')
INTO suppliers (supplier_id, supplier_name) VALUES (21, 'Microsoft')
INTO suppliers (supplier_id, supplier_name) VALUES (22, 'Apple')
SELECT * FROM dual;
Output :
3 row(s) inserted.
0.02 seconds
This is totally equivalent to the following three INSERT statements.
INSERT INTO suppliers (supplier_id, supplier_name) VALUES (1000, 'Google');
INSERT INTO suppliers (supplier_id, supplier_name) VALUES (2000, 'Microsoft');
INSERT INTO suppliers (supplier_id, supplier_name) VALUES (3000, 'Apple');
Oracle INSERT ALL Example: (Insert into multiple tables)
The INSERT ALL statement can also be used to insert multiple rows into more than one table by one command only.
In the following example, we are going to insert records into the both "suppliers" and "customers" tables.
INSERT ALL
INTO suppliers (supplier_id, supplier_name) VALUES (30, 'Google')
INTO suppliers (supplier_id, supplier_name) VALUES (31, 'Microsoft')
INTO customers (age, name, address) VALUES (29, 'Luca Warsi', 'New York')
SELECT * FROM dual;
Output :
3 row(s) inserted.
0.03 seconds
Here, total 3 rows are inserted, 2 rows are inserted into the suppliers table and one row into the customers table.
What Is Oracle
posted on 2019-11-29 01:11:21 - ORACLE Tutorials
ORACLE - Trigger
posted on 2019-11-28 22:14:22 - ORACLE Tutorials
ORACLE - Cursor
posted on 2019-11-28 22:13:54 - ORACLE Tutorials
ChatGPT Prompt Examples
posted on 2023-06-21 22:37:19 - ChatGPT Tutorials
Chat GPT Key Use Cases
posted on 2023-06-21 21:03:17 - ChatGPT Tutorials
Prompt Frameworks
posted on 2023-06-21 19:33:06 - ChatGPT Tutorials