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 table?
How do I import a csv file into db2?
What are the functions in DB2?
what is commit & rollback? When and where is used while compiling a cobol-db2 program?
What error I will get if my select query gives multiple row while executing a Cobol-DB2 program.How can I solve it without using a cursor.
4 Answers Cap Gemini, Verizon,
What are foreign keys in db2?
How to access db2 tables in mainframe?
What are bind parameters in db2?
What is role in db2?
How do u achieve record level locking in DB2 versions when record level locking is not allowed?
Is db2 relational database?
Is it possible to create an Instance in DB2 using DB2 Control Center ?