Updating and deleting data in CLI applications
Updating and deleting data is part
of the larger task of processing transactions in CLI.
There are two types of update and delete operations available in CLI programming:
simple and positioned.
A simple update or delete operation
only requires that you issue and execute the UPDATE or DELETE SQL
statements as you would any other SQL statement. You could, in this
case, use
SQLRowCount() to
obtain the number of rows affected by the SQL statement. Positioned
updates and deletes involve modifying the data of a result set. A
positioned update is the update of a column of a result set, and a
positioned delete is when a row of a result set is deleted. Positioned
update and delete operations require cursors to be used. This document
describes how to perform positioned update and delete operations by
first getting the name of the cursor associated with the result set,
and then issuing and executing the UPDATE or DELETE on a second statement
handle using the retrieved cursor name.Before you begin
Procedure
To perform a positioned update or delete operation: