Handling a parameterized UPDATE or DELETE statement
How you determine the input parameters in the WHERE clause of a
DELETE or UPDATE statement is similar to how you determine them in
the WHERE clause of a SELECT statement. For more information, see Handling a parameterized SELECT statement. The major differences
between these two types of dynamic parameterized statements are as
follows:
- You do not need to use a cursor to handle a DELETE or UPDATE statement. Therefore, you provide the parameter values from a system-descriptor area with the USING SQL DESCRIPTOR clause of the EXECUTE statement instead of the OPEN statement.
- You can use the DESCRIBE...USING SQL DESCRIPTOR statement to determine if the DELETE or UPDATE statement has a WHERE clause. For more information, see Check for a WHERE clause.