can we update the table by using cursors can anyone post
the query?

Answer Posted / siri

suppose we want update ename in emp table using cursor....

declare crsorname cursor for
select * from emp
where dept='d005'
for update of ename....


upate emp
set ename=:ename
where current of cursor

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do I add a column to a table in db2?

624


What are the contents of dclgen?

661


What is the use of dclgen in db2?

591


How to connect to db2 database from windows command line?

564


Why cursor is used in db2?

577






List out the buffer pools in db2

633


Which command is used to connect to a database in DB2 ? Give the Syntax.

602


What is plan in cobol db2?

595


How to restart a DB2 program?

1367


How do I import a csv file into db2?

563


Are views updateable?

647


What is the maximum number of columns in a db2 table?

725


I HAVE 500 ROW TO UPDATE I WOULD LIKE TO USE ROLLBACK ALONG WITH COMMIT.WHAT IS THE SYNTAX TO CODE COMMIT AND ROLLBACK FOR EVERY 100 ROWS.AND HOW THE CURSOR ROLLBACK TO THE LAST COMMITTING POINT.

2757


What is phantom read in db2?

641


How many databases are there?

593