...

Database Managment - Oracle

Back to Course

Lesson Description


Lession - #1421 Oracle INSERT ALL statement


Oracle INSERT ALL statement

The Oracle INSERT ALL assertion is utilized to embed various lines with a solitary INSERT explanation. You can embed the columns into one table or different tables by utilizing just a single SQL order.
Syntax

INSERT ALL  
  INTO table_name (column1, column2, column_n>
VALUES (expr1, expr2, expr_n>
INTO table_name(column1, column2, column_n>
VALUES (expr1, expr2, expr_n>
INTO table_name (column1, column2, column_n>
VALUES (expr1, expr2, expr_n>
SELECT * FROM dual;

Oracle INSERT ALL Example

This model determines how to embed numerous records in a single table. Here we embed three lines into the "providers" 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;


Oracle INSERT ALL Example: (Insert into different tables>

The INSERT ALL assertion can likewise be utilized to just embed different columns into more than one table by one order. In the accompanying model, we will embed records into the both "providers" and "clients" 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;