473,385 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to insert multiple rows with a single INSERT.

Hi,
I would like to know how to insert multiple rows into a table, using a
single INSERT statement. My requirement is like this I have a table ABC
which contains multiple employees entries with empId as the primary key.
Now I want to insert the all the empid multiplied by X and y (<EMPID>*x*y)
into a table DEF plus filling other columns for each employee rows.

Table ABC
---------
EMPID QQQ LLL MMM
1 5 "L" 20
4 45 "J" 43
6 63 "Q" 89

The table DEF need to be populated from ABC as below
Table DEF
---------
EMPIDMOD KKK MMM
1*X*Y 0 786
4*X*Y 0 786
6*X*Y 0 786
Thanks,
Tuhin
Jul 19 '05 #1
1 26447

"Tuhin Kumar" <tk****@ipolicynet.com> wrote in message
news:e4**************************@posting.google.c om...
Hi,
I would like to know how to insert multiple rows into a table, using a
single INSERT statement. My requirement is like this I have a table ABC
which contains multiple employees entries with empId as the primary key.
Now I want to insert the all the empid multiplied by X and y (<EMPID>*x*y)
into a table DEF plus filling other columns for each employee rows.

Table ABC
---------
EMPID QQQ LLL MMM
1 5 "L" 20
4 45 "J" 43
6 63 "Q" 89

The table DEF need to be populated from ABC as below
Table DEF
---------
EMPIDMOD KKK MMM
1*X*Y 0 786
4*X*Y 0 786
6*X*Y 0 786
Thanks,
Tuhin


Insert into DEF
(EMPID
,MOD
,KKK)
SELECT EMPID*x*y
, 0
, 786
FROM ABC;

ieVel
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Sans Spam | last post by:
Greetings! I have a table that contains all of the function permissions within a given application. These functions are different sections of a site and each has its own permissions (READ, WRITE,...
1
by: Brian Marasca | last post by:
I know that Oracle has extensive support for XML, but I can't seem to find any documentation on using an XML document to do multiple inserts into a relational table. Note, I'm *not* trying to...
20
by: Mark Harrison | last post by:
So I have some data that I want to put into a table. If the row already exists (as defined by the primary key), I would like to update the row. Otherwise, I would like to insert the row. I've...
4
by: Michel Esber | last post by:
Hello, Environment: db2 V8 FP 13 LUW Our application currently uses: insert into table values ('A'),('B'),...('Z') We have used CLI arrays inserts (1000 array and commit size) and...
3
Atli
by: Atli | last post by:
Hi. I've been trying to insert multiple rows into a table using a single INSERT statement in MSSQL / SQL Server 2005. I could of course cheat and have my C# code insert each row using some sort...
10
sumittyagi
by: sumittyagi | last post by:
Hi All, Is it possible in oracle to insert multiple rows in a single insert query, as is possible in sql server: insert into test_table values ('abc', 'xyz'), ('mno', 'pqr'); This syntax...
1
by: Tuhin Kumar | last post by:
Hi, I would like to know how to insert multiple rows into a table, using a single INSERT statement. My requirement is like this I have a table ABC which contains multiple employees entries with...
24
by: Henry J. | last post by:
My app needs to insert thousand value rows into a mostly empty table (data are read from a file). I can either use inserts, or use merge. The advantage of using merge is that in the few cases...
4
by: edtrvl | last post by:
Hi there, I'm trying to insert multiple rows from a table format web form into multiple rows in a SQL table, (1 row for 1 row). Any help would be greatly appreciated, thanks in advance Here's...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.