How to add multiple records at once using SQL in a table in Oracle Live SQL?
I have the used the statement in screenshot(as link) below but got an error-"ORA-00933: SQL command not properly ended"
How to add multiple records at once using SQL in a table in Oracle Live SQL?
I have the used the statement in screenshot(as link) below but got an error-"ORA-00933: SQL command not properly ended"
Another option is to use INSERT ALL
:
insert all
into students (sr_no, name, class, sec, contact, total_marks) values (1, 'Ravi' , 10, 'A', 12345, 579)
into students (sr_no, name, class, sec, contact, total_marks) values (2, 'Ria' , 10, 'B', 98765, 580)
into students (sr_no, name, class, sec, contact, total_marks) values (3, 'Aditi', 10, 'A', 98498, 570)
select * From dual;
You can use values in select .. from dual union all
and use INSERT INTO TABLE <t> SELECT ...
as follows:
insert into your_table
select val1,2,3,4,5 from dual union all
select val1,2,3,4,5 from dual union all
select val1,2,3,4,5 from dual union all
select val1,2,3,4,5 from dual