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 the maximum number of columns in a db2 table?
What is concurrency in db2?
if there is a table with huge number of records and if i want to extract only first 3 records from the table, what query i have to provide to retreive first 3 records
i hav created a program and moved to production but failed to create the table which is been used in the program. the program shows error as soon as it is moved or installed in production or shows error during its runtime. what is the sqlcode for this error
How to test SQL -911 error while developing COB-DB2 program
If a non-DB2 program calls a DB2 program, the calling program's name will be there in SYSIN of IKJEFT01 and the plan name will be that of the called program. But is a bind needed or a plan has to be created for the non-DB2 program also?
What is an instance in db2?
How to solve S0C7 abend with out using DISPlay in 10 mins?
What is an alias and how does it differ from a synonym?
What is a view? Why use it?
a cursor normally gets closed once we provide a commit . If u try to close the same cursor with close cursor command later after providing the commit will there be any sql-error.
What does the CHECK Utility do ?