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

Mention the downsides of page level lock.

699


What is plan in cobol db2?

580


Is db2 free?

677


What is db2 instance?

587


What is page size in db2?

559






How do you stop a db2 database in linux?

560


List out the three types of page locks that can be held.

678


Highlight all the advantages that are attached to a package.

619


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?

7477


What parameters are used to control the free space in DB2?

639


What is db2 optimizer?

763


When do you specify the isolation level?

603


How to create backup table in db2?

633


What is dbrm library?

571


What is the reason behind not using select * in embedded sql programs?

596