Help - Search - Members - Calendar
Full Version: INSERT INTO Statement in Oracle
Oracle DBA Forums > Oracle > Oracle Forum
shaeron
Hi

I just want to confirm one thing if anybody can help me out.

Is it possible to insert multiple rows simultaneously into a table without using select statement. Like when we create a new table and we hav to enter 100 records. Do we hav to write INSERT INTO statement 100 times ?



I'll be very thankful if anybody can resolve my problem.
Florin Aparaschivei
INSERT INTO table_name
SELECT field1, field2
FROM another_table
WHERE your_condition_from_subquery
dave
QUOTE (shaeron @ Jun 26 2008, 05:51 AM) *
Hi

I just want to confirm one thing if anybody can help me out.

Is it possible to insert multiple rows simultaneously into a table without using select statement. Like when we create a new table and we hav to enter 100 records. Do we hav to write INSERT INTO statement 100 times ?



I'll be very thankful if anybody can resolve my problem.


use sqlloader or external tables
Arthritic Toe
SQL> CREATE TABLE x (a NUMBER);

Table created.

SQL> BEGIN
2 FOR i IN 1..10 LOOP
3 INSERT INTO x VALUES (i);
4 END LOOP;
5 END;
6 /

PL/SQL procedure successfully completed.

SQL> select * from x;

A
----------
1
2
3
4
5
6
7
8
9
10

10 rows selected.

SQL>
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2014 Invision Power Services, Inc.