In db2, how do you insert multiple rows in 1 query using a.)
Cursors, b.) Normal query?? Give syntax for both.

Answer Posted / 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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the contents of a dclmgen?

629


How do I delete a column in db2?

680


What is meant by dclgen?

618


What is the difference between oracle and db2?

587


what is db2 restart?

1695






What is host variable in db2 cobol?

605


What types of tables are there in the db2 database?

556


Is db2 a programming language?

607


Define sqlca.

651


Explain correlated sub-queries.

589


What is ibm db2 database?

541


What is commit in db2?

596


What is the usage of open cursor command?

601


How can you do the explain of a dynamic sql statement?

637


What is cursor stability in db2?

813