How to insert more than one record using insert?

Answers were Sorted based on User's Feedback



How to insert more than one record using insert? ..

Answer / subi

Do an Insert using select
Insert into Table1(coltable1, coltable22)(select coltab21,
tab2col2 from Tab2 where <condn>)

Is This Answer Correct ?    9 Yes 2 No

How to insert more than one record using insert? ..

Answer / flando

Sandeep Kumar had it close. I found the answer here:

http://publib.boulder.ibm.com/infocenter/db2luw/v8/index.jsp
?topic=/com.ibm.db2.udb.doc/admin/r0000970.htm

insert into tablename (col1, col2)
values (valu1, valu2), (valu1, valu2), (valu1, valu2)

Is This Answer Correct ?    6 Yes 1 No

How to insert more than one record using insert? ..

Answer / harish

perform until ws-flag = 'y'
exec sql
insert into table('a','b','c','d','e')
values(a,b,c,d,e)
end-exec
evaluate sqlcode
when 000
continue
when 100
move 'y' to ws-flag

according to me ,pls let me any other remedy

Is This Answer Correct ?    3 Yes 2 No

How to insert more than one record using insert? ..

Answer / nahid gorji

using insert into table1 (column-list or *) 479 select
column-list or * from another table

Is This Answer Correct ?    1 Yes 1 No

How to insert more than one record using insert? ..

Answer / sandeep kumar

insert into tablename(col1, col2)
values(valu1, valu2)
values(valu1, valu2)
values(valu1, valu2)
values(valu1, valu2)
values(valu1, valu2)
values(valu1, valu2)
values(valu1, valu2)
values(valu1, valu2)
....................
....................

Is This Answer Correct ?    7 Yes 8 No

How to insert more than one record using insert? ..

Answer / ratheesh nellikal

U could probably go for a bulk insert also.
try this option

insert into schema.table1
select * from schema.table2;

Cheers,
Ratheesh Nellikal

Is This Answer Correct ?    0 Yes 1 No

How to insert more than one record using insert? ..

Answer / kalone

If we want to insert more than 1 row into a table , we
should go for SUBQUERIES rather than VALUES clause.

Is This Answer Correct ?    0 Yes 1 No

Post New Answer

More DB2 Interview Questions

What is a plan and package in db2?

0 Answers  


What is the difference between oracle and db2?

0 Answers  


If we have 100 records in the PF, we deleted all the records then what is the Size of the PF?

2 Answers  


Hi Everyone... Under the Logical files, when am working on multiple rec format logical file, I have joined two pf's using the multiple record format logical file concept, but when i run queried the LF only the first mentioned pf records are reflecting and I am not able to see any of the field records specified under the second pf. Kindly let me know whats the reason behind this. Below is the str of LF., R rec PFILE(LOGICAA) CUSTNO CUSTNAME BILL K CUSTNO R rec1 PFILE(LOGICAA1) CUSTNO ADD K CUSTNO .....

0 Answers  


by using cursors , we can access particular records from the table based on some condition, i want to delete those selected records, how can we write a query for this in the program?

4 Answers   Mphasis,






what are extents?

5 Answers  


Explain in detail about buffer manager and its functionalities?

0 Answers  


what is Runstats? Whem will u choose to runatats?

1 Answers   Danske,


What is deadlock?

2 Answers  


What is error -818 in db2. where can you find the timestamp of the DBRM and the source code.( precompile puts the timestamp on dbrm and source code correct?)

2 Answers  


What is netezza database?

0 Answers  


How can record locking be achieved in those DB2 versions which do not support it?

0 Answers  


Categories