Using positioned updates and deletes
- Last Updated: October 7, 2020
- 1 minute read
- DataDirect Connectors
- ODBC
- Aha! 8.0
- Amazon Redshift 8.0
- Apache Cassandra 8.0
- Apache Hive 8.0
- Apache Spark SQL 8.0
- Autonomous Rest Connector 8.0
- Cloudera Impala 7.1
- dBase 7.1
- + 24
Use positioned updates and deletes or SQLSetPos to update
data. Although positioned updates do not apply to all types of applications,
developers should use positioned updates and deletes when it makes
sense. Positioned updates (either through UPDATE WHERE CURRENT
OF CURSOR or through SQLSetPos) allow the developer to
signal the driver to "change the data here" by positioning the database
cursor at the appropriate row to be changed. The designer is not
forced to build a complex SQL statement, but simply supplies the
data to be changed.
In addition to making the application more maintainable, positioned updates usually result in improved performance. Because the database server is already positioned on the row for the Select statement in process, performance-expensive operations to locate the row to be changed are not needed. If the row must be located, the server typically has an internal pointer to the row available (for example, ROWID).