Updatable queries

<< Click to Display Table of Contents >>

Navigation:  Local SQL > Data Manipulation Language > Updatable queries >

Updatable queries

Previous pageReturn to chapter overviewNext page
hmtoggle_plus1See also

Definition...

Single-table queries

Queries that retrieve data from a single table are updatable provided that:

There is no DISTINCT key word in the SELECT.

Everything in the SELECT clause is a simple column reference or a calculated column, no aggregation is allowed. Calculated columns remain read-only.

The table referenced in the FROM clause is an updatable base table.

There is no GROUP BY or HAVING clause.

There are no subqueries in the statement.

There is no ORDER BY clause.

The read-only effect of an ORDER BY clause is negated and the query updatable if the ORDER BY clause uses a single column and there is a dBASE single-column primary or secondary index based on that same field. dBASE compound (expression) indexes will not negate the read-only effect of an ORDER BY clause. A Paradox single- or multi-field primary index will make the query updatable if the ORDER BY uses exactly the same columns (in the same order) as the index. Paradox secondary indexes will not negate the read-only effect of an ORDER BY clause.

Multi-table queries

All queries that join two or more tables will produce a read-only result set.

Calculated fields

For updateable queries with calculated fields, an additional field property identifies a result field as both read-only and calculated. Every call to the BDE function DbiPutField causes recalculation of any dependent fields.