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
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 |
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 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 |
What is a DB2 access path?
What's the Maximum Length of SQLCA and what's the content of SQLCABC?
Plan is an executable form of sql statements,But what exactly resides inside a Plan. what are the details inside Plan.
Define db2 and its databases?
What if we fail to give values in columns declared as NOT NULL ?
What is the difference between db2 and oracle?
What is db2 optimizer?
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 ?
How can you do the explain of a dynamic sql statement?
What type of database is db2?
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?
which SQL comment successfully removes uncommitted changes from a DB2 database A) rollback B) delete C) drop D) decommit