Queries

<< Click to Display Table of Contents >>

Navigation:  Basic concepts > Database entities >

Queries

Previous pageReturn to chapter overviewNext page

The common query engine allows you to specify queries in either the SQL or QBE language on any available data source. Through queries, BDE allows uniform data retrieval across data sources. The local query manager enables you to join data across servers. For example, you can join Oracle to dBASE, Sybase to Paradox, or InterBase to Oracle on two different servers. To run cross-database queries, the table names in a query must be qualified by alias names. Cross-database queries are supported only with standard database handles, even if the query is targeted for SQL servers.

BDE provides a set of query interface functions so that the application developer can query tables across all accessible databases:

DbiQAlloc obtains a new statement handle

DbiQGetBaseDescs returns the original database, table, and field names of the fields that make up the result set of a query.

DbiSetProp sets properties on the new statement handle, such as making the query result set updateable.

DbiQPrepare prepares a SQL or QBE query for execution.

DbiQSetParams sets the value of parameter markers in a prepared query before the query executes.

DbiQExec executes a previously prepared query.

DbiQFree frees resources acquired during preparation and execution of a query.

DbiQExecDirect prepares and executes a SQL or QBE query.

BDE allows access to SQL, Paradox, dBASE, FoxPro, or Access data through both SQL queries, a convenient subset of the SQL language, and QBE queries, the Query By Example language defined in Paradox. For both QBE and SQL, a query can be executed as a live result set, resulting in an updateable cursor on the original table.

For detailed information on querying, see:

Querying databases

Querying Paradox, dBASE, FoxPro, and Access tables

Querying different databases

Executing queries directly

Executing queries in stages