ASA Programming Guide
ODBC Programming
Working with result sets
The Microsoft ODBC Programmer's Reference suggests that you use SELECT... FOR UPDATE to indicate that a query is updateable using positioned operations. You do not need to use the FOR UPDATE clause in Adaptive Server Anywhere: SELECT statements are automatically updateable as long as the following conditions are met:
The underlying query supports updates.
That is to say, as long as a data modification statement on the columns in the result is meaningful, then positioned data modification statements can be carried out on the cursor.
The ANSI_UPDATE_CONSTRAINTS database option limits the type of queries that are updateable.
For more information, see ANSI_UPDATE_CONSTRAINTS option [compatibility].
The cursor type supports updates.
If you are using a read-only cursor, you cannot update the result set.
ODBC provides two alternatives for carrying out positioned updates and deletes:
Use the SQLSetPos function.
Depending on the parameters supplied (SQL_POSITION, SQL_REFRESH, SQL_UPDATE, SQL_DELETE) SQLSetPos sets the cursor position and allows an application to refresh data, or update, or delete data in the result set.
This is the method to use with Adaptive Server Anywhere.
Send positioned UPDATE and DELETE statements using SQLExecute. This method should not be used with Adaptive Server Anywhere.