Previous Topic: Specify a Cursor NameNext Topic: Execute the Update


Execute the Query

The application executes an updatable query expression, using the SQLPrepare and SQLExecute or SQLExecuteDirect functions. An updateable query has the form:

SELECT query-expression FOR UPDATE [OF column-list]

CA IDMS requires the FOR UPDATE clause for a positioned update; it is optional for a positioned delete. The application program must include this clause. The ODBC driver does not scan the syntax for it and does not generate an error if the clause is present when the cursor concurrency is set to SQL_CONCUR_READ_ONLY. See the CA IDMS Database SQL Option Reference Guide for detailed documentation on updateable query expressions.

The application program uses the SQLFetch function to position the cursor on the desired row. The CA IDMS Server ODBC driver disables the BULK FETCH and piggybacked CLOSE optimizations to ensure that the cursor is positioned on the row that is returned to the application.