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?

Answers were Sorted based on User's Feedback



by using cursors , we can access particular records from the table based on some condition, i want..

Answer / satty

first declare cursor and select the records you wanted and
then use delete statement with where current of your cursor.
becoz it will help you to delete that particular record
which has been choosed.

if any thing wrong plz intimate

Is This Answer Correct ?    8 Yes 0 No

by using cursors , we can access particular records from the table based on some condition, i want..

Answer / vaneesh khurana

Hi Satty
Can you please let us know what command you will use for
delete.
Vaneesh

Is This Answer Correct ?    0 Yes 0 No

by using cursors , we can access particular records from the table based on some condition, i want..

Answer / vaneesh khurana

By the way, why to select a signle row using cursor then
delete, if you want to delete all the row mentioned in the
cursor search creteria, simply write a SQL query mentioning
delete where (matching search condition).

Is This Answer Correct ?    0 Yes 2 No

by using cursors , we can access particular records from the table based on some condition, i want..

Answer / narayana reddy

delete current(cursor) from table

Is This Answer Correct ?    0 Yes 3 No

Post New Answer

More DB2 Interview Questions

What is a DB2 access path?

1 Answers  


What's the Maximum Length of SQLCA and what's the content of SQLCABC?

2 Answers  


Plan is an executable form of sql statements,But what exactly resides inside a Plan. what are the details inside Plan.

2 Answers   IBM,


Define db2 and its databases?

0 Answers  


What if we fail to give values in columns declared as NOT NULL ?

3 Answers   Cap Gemini,






What is the difference between db2 and oracle?

0 Answers  


What is db2 optimizer?

0 Answers  


suppose in my table 10 rows are there , i want to update odd rows salary as 90000 ? how u do it ? any one help me ? what do we use here cursor-fetch or normal sql ?

5 Answers   IBM,


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

0 Answers  


What type of database is db2?

0 Answers  


I have two tables A and B. Both tables are connected with SSN number as foreign key. I want to retrieve a column data from B table. How will you write a query?

3 Answers   CTS,


which SQL comment successfully removes uncommitted changes from a DB2 database A) rollback B) delete C) drop D) decommit

2 Answers   Accenture, Wipro,


Categories