Home >> Oracle >> INSERT ALL Query in Oracle

INSERT ALL Query in Oracle

To insert multiple rows at a time the Oracle INSERT ALL statement is used.

Syntax

INSERT ALL  
INTO table_name (column_1, column_2, column_n) VALUES (expr_1, expr_2, ... expr_n)  
INTO table_name(column_1, column_2, column_n) VALUES (expr_1, expr_2, ... expr_n)  
INTO table_name (column_1, column_2, column_n) VALUES (expr_1, expr_2, ... expr_n) 
INTO table_name (column_1, column_2, column_n) VALUES (expr_1, expr_2, ... expr_n) 
Subquery;

Example

INSERT ALL  
INTO students(student_id, student_name, student_city)  VALUES  (1, 'Ram', 'Delhi');  
INTO students(student_id, student_name, student_city)  VALUES  (2, 'Shyam', 'Delhi');  
INTO students(student_id, student_name, student_city)  VALUES  (3, 'Ghanshyam', 'Banglore');  
INTO students(student_id, student_name, student_city)  VALUES  (4, 'Sonu', 'Lucknow');
SELECT * FROM dual;

Post Your Comment

Next Questions
UPDATE Query
DELETE Query
WHERE clause
AND Clause
OR Clause
LIKE clause
IN clause
ORDER BY Clause
GROUP BY Clause
HAVING Clause
BETWEEN
EXISTS
NOT EXITS
ANY
ALL
MAX
MIN
AVG
COUNT
SUM
What is key
What is Super Key
What is Candidate Key
What is Primary Key
What is Unique Key

Copyright ©2022 coderraj.com. All Rights Reserved.