
- Forum
- Database
- Oracle Database
- Insertion of multiple values using a single insert statement in oracle 10g
Insertion of multiple values using a single insert statement in oracle 10g
This is a discussion on Insertion of multiple values using a single insert statement in oracle 10g within the Oracle Database forums, part of the Database category; Hey i am trying to insert multiple values in a table using a single insert into statement.I just wanted to ...
-
09-16-2008, 10:29 PM #1
- Join Date
- Sep 2008
- Answers
- 1
Insertion of multiple values using a single insert statement in oracle 10g
Hey i am trying to insert multiple values in a table using a single insert into statement.I just wanted to avoid writing multiple insert into statements for entering data into a table.Is there any way i can do this.
I tried this way
create table ike
(Name varchar(25),
age number(3),
phn number(10),
salary number(9,2));
i created this table and tried unserting values
insert into ike('&name',&age,&phn,&salary);
Enter value for name:
Enter value for age:
Enter value for phn:
Enter value for salary:
When i entered the values it read an error message
Error at line 2
ORA 00928:missing Select keyword in line 1.
i then tried to enter agai by using backslash(/)
SQL>/
but it showed me the same error..
could any 1 make out a point of this...
I have seen a post about this here but i could'nt find it now.
Thanx in advance
Last edited by simplyshravan; 09-16-2008 at 10:33 PM. Reason: Made my doubt more cleared to the viewers
-
09-19-2008, 01:31 AM #2
- Join Date
- Sep 2008
- Answers
- 1
You can trying insert into (select statement) to load the data; can you be more specific
-
01-16-2011, 11:26 PM #3
- Join Date
- Jan 2011
- Answers
- 14
You can trying insert into (select statement) to load the data; can you be more specific. This thing always remember. It is really amazing and outstanding.
-
01-30-2012, 01:56 PM #4
- Join Date
- Jan 2012
- Answers
- 1
as like
insert into <source table> select * from <dist table>
-
Hello,
Here is another way to insert multiple records with one insert
ThanksCode:INSERT INTO `category` (`cat_id`, `cat_pid`, `cat_name`, `cat_url`, `cat_desc`, `cat_mttl`, `cat_mkey`, `cat_mdsc`) VALUES (1, 0, 'Certification', 'Certification', '', '', '', ''), (2, 0, 'Java', 'Java', '', '', '', '');
-
insert into ike(name,age,phn,salary)
values(&name,&age,&phn,&salary);
execute above statement then you will be asked to enter values as shown
enter value for name:
enter value for age:
enter value for phn:
enter value for salary:
provide details one by one. all your data will be inserted
(or)
type complete sql query in notepad along with semicoln for all values and then copy paste it in SQL plus command line.
all values will be inserted at once.
ex:
write queries in notepad like:
insert into friends values(002,'satish','kolar','ait','ec','098hh');
insert into friends values(003,'srinivas','mysore','ait','ec','099hh');
insert into friends values(004,'arjun','kolar','jss','ec','048hh');
copy paste all querries will executed automatically and will be inserted into the table.
-
Sponsored Ads

Reply With Quote





