top button
Flag Notify
    Connect to us
      Facebook Login
      Site Registration Why to Join

Facebook Login
Site Registration

What is the use of INSERT ALL in SQL/Oracle?

+2 votes
44 views
What is the use of INSERT ALL in SQL/Oracle?
posted Jul 27, 2015 by Suchithra

Share this question
Facebook Share Button Twitter Share Button Google+ Share Button LinkedIn Share Button Multiple Social Share Button

1 Answer

0 votes

INSERT ALL is used to insert multiple rows into a single table or different tables in a signle SQL statement.

SYNTAX

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

mytable:                       The table to insert the records into.
column1, column2, column_n:    The columns in the table to insert values.
expr1, expr2, ... expr_n:      The values to assign to the columns in the table.

Example

INSERT ALL
INTO suppliers (supplier_id, supplier_name) VALUES (1000, 'QueryHome')
INTO suppliers (supplier_id, supplier_name) VALUES (2000, 'ABC')
INTO customers (customer_id, customer_name, city) VALUES (999, 'XYZ Construction', 'New Delhi')
SELECT * FROM dual;
answer Jul 27, 2015 by Salil Agrawal
Contact Us
+91 9880187415
sales@queryhome.net
support@queryhome.net
#280, 3rd floor, 5th Main
6th Sector, HSR Layout
Bangalore-560102
Karnataka INDIA.
QUERY HOME
...