In db2, how do you insert multiple rows in 1 query using a.)
Cursors, b.) Normal query?? Give syntax for both.
Answers were Sorted based on User's Feedback
Answer / vaibhav
We can insert by using the following command:-
Insert into tablename
(col1,col2,col3,....)
values(&emp-no, '&emp-name', .....)
| Is This Answer Correct ? | 7 Yes | 5 No |
Answer / adi
MOVE +100 TO HV-NUM-ROWS.
INSERT INTO EMP
(EMPNO, LASTNAME, FIRSTNME,
MIDINIT, SALARY, BONUS)
VALUES (:HV-EMPNO-ARRAY,
:HV-LASTNAME-ARRAY,
:HV-SALARY-ARRAY,
:HV-BONUS-ARRAY)
FOR :HV-NUM-ROWS
ATOMIC
all array elements will have a 100 occur clause
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / uma
We can't insert multiple row in single query for the we
have to use cursor.
| Is This Answer Correct ? | 5 Yes | 5 No |
Answer / shekhar
insert into table1
select * from table2
where cond
this query will insert multiple rows at once.
there is load utility of DB2 can help in inserting bulk data from data file.
Plz correct me if i m wrong.
| Is This Answer Correct ? | 2 Yes | 2 No |
Answer / siri
insert into tableName
(col1, col2, col3, col4, col5)
values
(val1, val2, val3, val4, val5),
(val1, val2, val3, val4, val5),
(val1, val2, val3, val4, val5),
(val1, val2, val3, val4, val5);
| Is This Answer Correct ? | 4 Yes | 5 No |
what is the total syntax for fetch ? can any one please give me all the details of fetch ? thx
Which component is responsible for processing sql statements and selecting access paths?
Is DECLARE TABLE in DCLGEN necessary? Why it used?
What are the contents of a dclmgen?
When you are working with the project after coding what will u do? Like what type of documents u will prepare? How will u do testing?
What are the benefits of using the db2 database?
What's the difference between DB2 active log and archive log? Thanks a lot...
which SQL comment successfully removes uncommitted changes from a DB2 database A) rollback B) delete C) drop D) decommit
What is a db2 collection?
How can you display the current date & current time ?
What is bind and rebind in db2?
how to resolve -818 error. how to see timestamp token in load module and plan