Querying external databases

You can query external databases to access information in an ODBC data source and database files created using Paradox, Reflex, or dBASE (versions II, III, and IV) applications. Querying external databases lets you extract information from the database without first having to translate the file.

When you query external databases, you must create a criteria table specifying the type of information for which you are searching and output cells to hold the results of the search. For information about criteria tables and output cells, see “Preparing queries for searching notebook databases.”

You can also Query By Example (QBE), which, in database management systems, refers to a method of forming queries in which the database program displays a blank record with a space for each field. You can enter conditions for each field to be included in the query. For example, to find all records where the age field is greater than 65, you would type >65 in the age field.

Once you create a .qbe file, you can run the QBE query from Quattro Pro. A QBE query in a notebook selection always starts with the word Query and ends with the word EndQuery. The best way to learn the QBE syntax is to create queries in Paradox, import them into Quattro Pro, and then experiment by revising them.

An alias is a shortcut name that takes the place of a long path name. When using external database tables, it is convenient to assign aliases for your private and working directories. A private directory is a location for your temporary answer tables and other files that are not shared. A working directory is where a database application or a feature looks for external database tables.


To query external databases

Wordperfect Quattro Pro btnbacktotopproc Querying external databases
1.
 
Click Tools Wordperfect Quattro Pro onestep Querying external databases Data tools Wordperfect Quattro Pro onestep Querying external databases Notebook query.
2.
 
In the Database cells box, type the path of the external database file using linking syntax.
You do not need to type the path if the database path is already in your working directory.
3.
 
Select the criteria table using the Range picker Wordperfect Quattro Pro pgx btnsel Querying external databases.
4.
 
Select the row of the output cells which contains the field names using the Range picker Wordperfect Quattro Pro pgx btnsel Querying external databases.
5.
 
Click Extract.

Wordperfect Quattro Pro note Querying external databases

 
The format of linking syntax is [Database]A1..A2, where [Database] is the name of the database, including the path; for example, C:\PARADOX\SAMPLE.DB. The cells specified after the filename can be any valid area with at least two rows. A1..A2 acts as a hook into the database. It remains A1..A2, no matter the size of the database area.
 
If your criteria contain formulas with cell references to data elsewhere, those cell references must be absolute. For example, for a table with Name and Age as column titles, you could type +~age>25 to identify all entries where age>25. To reference the cell C1 that contained the value 25, typing +AGE>C1 would not work; instead, you would need to type +~AGE>$A:$C$1 as the criteria, using absolute references.

To use Query By Example

Wordperfect Quattro Pro btnbacktotopproc Querying external databases
1.
 
Click Insert Wordperfect Quattro Pro onestep Querying external databases External data Wordperfect Quattro Pro onestep Querying external databases Table query.
2.
 
Enable one of the following options:
Query in file — indicates that the query is located in a .qbe file
Query in selection — indicates that the query is located in a notebook selection
3.
 
Type the location of the query in the Query file box.
4.
 
Select the destination for the query results in the Destination box using the Range picker Wordperfect Quattro Pro pgx btnsel Querying external databases.

Wordperfect Quattro Pro note Querying external databases

 
The QBE query and the database table must be in your working directory.
 
You can make a query selection easy to read by setting the font for the QBE selection to a nonproportional font such as Courier.

To assign aliases for private and working directories

Wordperfect Quattro Pro btnbacktotopproc Querying external databases
1.
 
Click Insert Wordperfect Quattro Pro onestep Querying external databases External data Wordperfect Quattro Pro onestep Querying external databases Aliases.
2.
 
Type the path for your private directory in the Private directory box.
3.
 
Type the path for your working directory in the Working directory box.

Wordperfect Quattro Pro tip Querying external databases

 
You can also click Browse Wordperfect Quattro Pro pgx browse Querying external databases to insert a path.

Querying external databases