How to insert more than one record using insert?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
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 |
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 |
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 |
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 |
What is a Resource Control Table(RCT)? Describe its characteristics.
Where to download IBM DB2 Certification Dumps for the below: C2090-311 : IBM DB2 10.5 DBA for LUW Upgrade from DB2 10.1 C2090-312 : IBM DB2 11 DBA for z/OS C2090-313 : DB2 11 Application Developer for z/OS C2090-317 : DB2 11 System Administrator for z/OS C2090-541 : DB2 9.7 DBA for Linux UNIX and Windows C2090-543 : DB2 9.7 Application Development C2090-544 : DB2 9.7 Advanced DBA for LUW C2090-545 : DB2 9.7 SQL Procedure Developer C2090-546 : DB2 9.7 Database Administrator for Linux UNIX or Windows Upgrade C2090-610 : DB2 10.1 Fundamentals C2090-611 : DB2 10.1 DBA for Linux, UNIX, and Windows C2090-612 : DB2 10 DBA for z/OS C2090-614 : DB2 10.1 Advanced DBA for Linux UNIX and Windows C2090-615 : DB2 10.5 Fundamentals for LUW C2090-617 : DB2 10 System Administrator for z/OS C2090-730 : DB2 9 Family Fundamentals C2090-733 : DB2 9 Application Developer C2090-735 : DB2 9.5 SQL Procedure Developer C2090-737 : DB2 9 System Administrator for z/OS Exam
What is ibm db2 client?
can any body explain about plan and pakage in detail....
how will i display the duplicate record's from a table... i don't want to eliminate ...i want to display the duplicate record...for example in my table i have 10 record's like record no(1,2,3,4,2,9,6,1) in this ...so i want to receive duplicates...
What is a synonym? How is it used?
What are concurrency issues?
What is the difference between cursor and select statement?
we can code COPY DCLGEN or INCLUDE DCLGEN, At which stage of the precompilation , dclgen get expanded if we write 1) copy 2) include one question about dclgen.. Is it mandatory to use declare table in dclgen.. I think no...but it will be used by the precompiler to validate the table name,column name etc.., can one clear my doubt ..is it necessary to include declare table or not?
What does sqlcabc has?
Parm value passed is PARM=(10,20). how do code linkage section and how would you add these two passes values and show result in cobol program.
in column y record abc.v abc.s xyz.j abc.h i wan only abc columns how to retrieve thi records