Delphi - Database Desktop Users Guide PDF
Delphi - Database Desktop Users Guide PDF
Guide
Delphi for Windows
I n t r o d u c t i o n
Copyright
Agreement
Database Desktop is a compact relational database application that you can use either as
a standalone application on a single computer running Windows or as a multiuser
application on a network. It gives users of supported products an easy way to create,
edit, and query tables.
This User’s Guide contains information on using Database Desktop to work with data
tables in a variety of formats. Database Desktop is a powerful tool you can use to
• View tables and edit the data in them
• Query databases to retrieve information
• Create new tables or modify the structure of existing tables
SQL If you have Borland® SQL Link, you can use it with Database Desktop. For more
information, see the Database Desktop Help Contents.
Windows To gain the full benefits of Database Desktop, you should first familiarize yourself with
note Microsoft Windows. This manual assumes you already understand Windows and
Windows-specific terminology. For help with Windows, see your Windows
documentation.
Introduction 1
Chapter 6, “Running SQL statements,” explains how to use the SQL Editor to enter and
execute SQL statements.
Chapter 7, “Querying table data with QBE,” describes how to extract and manipulate
information in databases.
Appendix A, “Using the keyboard,” lists the keyboard equivalents for Database
Desktop mouse actions.
Conventions
The different typefaces in this manual are used as follows:
Monospace typeface represents text as it appears on the screen, and anything you must
type. Italics are used for table names, for emphasis, and to introduce new terms. Keycap
typeface indicates a key on your keyboard. It often indicates a key you should press—
for example, “Press Enter to complete an entry.”
Note Notes give additional information on the subject at hand, such as exceptions to a general
rule, or more technical detail for advanced users.
Caution Cautions alert you to the potential loss of information.
Tip Tips include helpful suggestions and shortcuts.
When commands appear in full (the name of the command preceded by the “path”
used to get to it), the individual commands in the path are separated by vertical bars (|).
For example, “File|Open” refers to the command you choose by opening the File menu,
then choosing Open.
Database concepts
Chapter 1
1
This chapter introduces some Database Desktop concepts:
• Understanding tables
• Using keys, indexes, and links
• Querying (searching) databases
This manual assumes that you’re familiar with basic Windows terminology.
Understanding tables
A database is an organized collection of information or data. An address book is a
simple example of a database. It organizes data about people into specific categories:
names, phone numbers, and addresses.
In a relational database, the data is organized into tables. Each row of a table contains
information about a particular item; this is called a record. Each column contains one
piece of the information that makes up a record; this is called a field. The next figure
shows how information is divided into records and fields.
Relational tables
Relational database applications such as dBASE and Paradox give you a way to link
tables by comparing values stored in comparable fields in separate tables. The data in a
relational database is the information stored in all the related tables. The advantage of a
relational database is that you can easily extract or combine data from several tables to
get exactly the information you need, without changing the structure of the database.
Also, a few small and discrete tables are more convenient to use and maintain than one
large table.
The sample database files CUSTOMER.DB and BOOKORD.DB are examples of
relational tables. These tables can be linked through the fields containing customers’ ID
numbers (Cust ID in the Customer table, Cust in Bookord). When the tables are linked,
you can extract information from both tables into one table. For example, you can search
for and extract a list of quantities ordered (from the Bookord table) and the respective last
names (from Customer). The results are returned in an Answer table (see page 7).
Using indexes
An index is a file that Database Desktop uses to keep track of the location of records in a
table. This makes it easy for Database Desktop to
• Maintain a sorted order of a table
• View like values together, if you have Paradox
When you create an index, Database Desktop creates a file that contains the indexed
field’s values and their locations. Database Desktop refers to the index file when
locating and displaying the records in a table. With Paradox tables, this is true of both
primary indexes (keys) and secondary indexes. A secondary index gives you the ability to
view a Paradox table’s data in an order different from that of the table’s key, if you have
Paradox.
dBASE indexes
As with Paradox tables, indexes for dBASE tables determine the order in which
Database Desktop accesses the records in a table. Indexes organize records so that data
can be found more quickly. When a dBASE table is indexed, Database Desktop creates a
file that contains the indexed field’s values and their corresponding record numbers.
Database Desktop refers to this index file when locating and displaying the records in a
table.
Querying databases
A query is a question you ask about the information in database tables. It can be a simple
question about information in one table, or a complex question about information in
several tables.
You can use queries to
• Find or select information from a table
• Combine information from multiple tables
• Perform calculations on data in a table
• Insert or delete data in a table
• Change values in a table
• Define groups and sets of information on which to perform calculations and
comparisons
Query by example
Database Desktop uses a technique called query by example (QBE) to extract and
manipulate data in external database tables. When you run a query in Database Desktop
you actually access external database tables. You can also search several related tables at
a time.
You perform a query in Database Desktop in the Query window. First you choose
which table(s) to query. Then you enter an example of the information you want and
run the query. Database Desktop looks at the query and the tables involved, and
determines the best way to arrive at the result. The result appears in a separate Answer
table (see the next section).
The next figure shows a query that gives examples of the fields you want to see (and a
range of values within one of those fields), and the answer Database Desktop gives.
Answer tables
The result of a query is a temporary table called Answer. The Answer table is overwritten
each time a query is run. For information on saving the data in an Answer table, see
“Saving the query” on page 98.
Other temporary tables are sometimes created when a query is run, such as Deleted and
Inserted.
SQL queries
You can query SQL tables using either QBE or the SQL Editor. The following figure
shows a query in the SQL Editor. Database Desktop displays the query results in an
Answer table.
Toolbar
Status line
Files you open in Database Desktop appear in their own type of windows. Tables
appear in Table windows, and queries appear in Query windows.
Each type of window has some commands and functions that apply only to that type.
The File, Utilities, Window, and Help menus are always available in the application
window, even when no other windows are open.
Open
Query
Arranging windows
Use commands on the Window menu to arrange windows and icons:
• Tile divides the available space in the application window among open table and
query windows.
• Cascade stacks open table and query windows so their title bars are visible.
• Arrange Icons arranges file icons evenly on the application window.
Managing files
In Database Desktop you work with three types of files: QBE queries, .SQL files, and
tables. The other types of files are created automatically by Database Desktop.
The following table lists the file extensions of all files used by Database Desktop.
Table 2.1 File extensions
Extension Type of file
.CFG Configuration files, used to store aliases and system configuration settings.
.DB Paradox table.
.DBF dBASE table.
.DBT Memo field values for a dBASE table.
.FAM Listing of related Paradox files (like a table’s .TV file)
.INI Preference files, used to store working directory settings.
.MB Memo field values for a Paradox table.
.MDX Maintained index of a dBASE table.
.NDX Non-maintained index of a dBASE table.
.PX Primary index of a Paradox table.
.QBE Saved QBE query.
.SQL Saved SQL statement.
.TV Table view settings for a Paradox table.
.TVF Table view settings for a dBASE table.
.VAL Validity checks and referential integrity for a Paradox table.
.Xnn Secondary index for a Paradox table, numbered. A secondary index defines an alternate
view order to temporarily change the display order of the records.
.Ynn Secondary index for a Paradox table, numbered.
.XGn Composite secondary index for a Paradox table.
.YGn Composite secondary index for a Paradox table.
By default, all indexes organize and access data in ascending order (A to Z, or 0 to 9).
Opening files
1 Choose File|Open.
2 Choose the type of file to open—QBE query, SQL statement, or table.
3 Specify the file to open.
The dialog box has a Drive (or Alias) list and a File Type list.
Note To access tables stored on a network, you must tell Database Desktop the location of the
network control file. You do this by running the BDE Configuration Utility; double-click
To enter multiple passwords, choose the Add button after each password you type. This
lets you enter passwords for several password-protected tables that you plan to use in a
session.
To delete one or more passwords, choose the Remove button after each password you
type. This lets you delete passwords from the password list.
To delete every password, choose the Remove All button to delete the password list for
the current session.
Note While a password-protected table is open or in use by a query, deleting its password
from the password list has no effect until you close the table or query. The next time you
try to access the table, however, the Enter Password(s) dialog box will appear.
Saving files
To save a query or SQL statement, choose File|Save or File|Save As. Database Desktop
saves QBE queries with a .QBE file extension and SQL statements with a .SQL file
extension.
To save a table you’re creating, choose Save As in the Create Table dialog box. Database
Desktop saves the table structure with a .DB or .DBF file extension and closes the dialog
box. If you didn’t complete all the necessary steps or if you’ve entered conflicting or
invalid specifications, Database Desktop prompts you to correct the problem(s).
You don’t use the File|Save or File|Save As commands to save a table’s data. Database
Desktop automatically saves data as soon as you do anything that unlocks the record
(such as moving off the record, turning off Edit mode, or choosing Record|Unlock).
To save a table’s property changes (column width, arrangement, scroll locks, and row
height), choose Properties|Save from the Table window. Changes are saved to a file
with the same name as the table, and with a .TV (for Paradox) or .TVF (for dBASE) file
extension.
Note If you make changes to a table’s properties and don’t save them, Database Desktop asks
if you want to save them when you close the table.
Aliases
An external database is a collection of files. These files can be kept in a directory on your
local hard disk or on a network server. You can assign a name (an alias) as a shortcut to a
directory using the Alias Manager dialog box.
For example, if you have a collection of tables and queries in one directory (called
C:\DBD\PROJECTS\CUSTLIST), you can just specify the alias :MYWORK: rather than
type the entire path.
Using aliases, you can avoid typing long path names, and you can use the Path list in
File|Open and File|Save dialog boxes to list files in a different aliased directory.
Creating an alias
1 Choose File|Aliases. The Alias Manager dialog box appears:
Figure 2.3 The Alias Manager dialog box
Removing an alias
1 Choose File|Aliases.
2 Specify the alias to remove.
3 Choose the Remove button.
4 Choose OK.
.SQL files
A .SQL file is an object that contains code you write in SQL (Structured Query
Language). Information about using SQL with Database Desktop and about using
Database Desktop to work with remote data is located in the Database Desktop Help
system.
You can use the SQL Editor to write SQL code to perform operations on remote data
using Borland SQL Links. You can also write query scripts using SQL that you can run
on local Paradox or dBASE data. For information about using the SQL Editor, see
Chapter 6.
Creating tables
Chapter 3
3
This chapter discusses how to create and restructure Paradox, dBASE, and SQL tables in
Database Desktop. It shows you how to
• Define field names, choose field types, and specify field sizes
• Define validity checks and table lookup
• Create keys, indexes, and referential integrity
• Establish password security
• Restructure existing tables
• View table structures
Note You can create tables in Database Desktop with many sophisticated field types, some of
which you can enter data in only if you have Paradox or dBASE. In Database Desktop
you cannot edit data in the following field types:
• Paradox: Memo, Formatted Memo, Graphic, OLE, Autoincrement, Binary, or Bytes
• dBASE: Memo, OLE, or Binary
• SQL: any BLOB (binary large object) field or a text field that allows more than 255
characters
To enter or edit data in these field types, use Paradox for Windows or dBASE, or an
application that supports editing those field types.
Planning tables
Planning is the first step in creating a table. You need to decide what you want the table
to contain and how you want to lay it out. When you plan a table, keep these guidelines
in mind:
• Put as little information as possible in each field. This allows for more flexible data
maintenance and more straightforward querying. For example, if you break an
address into separate fields for street, city, and state, you can easily query on these
specific field values.
Choose the type of table you want to create. Some options discussed
in this chapter are available only to Paradox for Windows 5.0 tables.
2 If you want a table type other than Paradox for Windows, click the arrow next to the
list box and select from the drop-down list.
3 Choose OK.
The Create Table dialog box appears, where you can specify the structure of the new
table.
Figure 3.1 The Create Table dialog box
Enter the field name, type, Press any key or double-click
and size in the Field Roster. to key the table.
Choose this to borrow the The status box gives you guidelines as
structure of another table. you create the table.
Defining fields
Use the Field Roster in the Create Table dialog box (page 19) to define the fields of the
new table. You can use the mouse, arrow keys, Enter, Tab, or Shift+Tab to move among the
columns. (Shift+Tab moves backwards.) As you move, a status message at the bottom of
the dialog box prompts you for valid entries. A vertical scroll bar appears in the Field
Roster if there are more fields than Database Desktop can display.
Field names
Type field names in the Field Name column of the Field Roster. The following lists give
you rules for naming fields in Paradox tables and in dBASE tables.
To delete a field
Place the insertion point in any column of the field you want to delete, then press
Ctrl+Del. Database Desktop deletes the entire row.
If you do not want to delete a whole row, place the insertion point in the column whose
value you want to delete and press Backspace or select the field and begin typing.
Database Desktop overwrites the previous value.
To insert a field
Select the field below which you want to insert the field and press Ins. Database Desktop
opens a blank row, ready for you to type the field name.
To reorder fields
Click the row number of the field and drag it to its new location. Remember that
Paradox key field(s) must occur first in the table’s structure.
1. In data entry, users would enter the value 10–307 in scientific notation by typing 1e–307; they would enter the value 10308
by typing 1e308. By default, the format of values in scientific notation is established by the Windows Control Panel and
the displayed value is a rounded-off version of the actual stored value.
2. Available only in Paradox 5.0 tables.
3. Available only in Paradox 5.0 tables. Database Desktop correctly interprets BCD data from other applications that use the
BCD type. However, when Database Desktop performs calculations on BCD data, it converts the data to a numeric float
type, then converts the result back to BCD.
4. All B.C. years are treated as leap years. You need Paradox for Windows to change format so B.C. dates display correctly.
5. Not available in Paradox 3.5 tables. Memo and formatted memo fields can be virtually any length. The size value you specify
in the Create Table dialog box refers to the amount of the memo Paradox stores in the table. This can be from 1 to 240
characters. The whole memo is stored outside the table. For example, if you assign a size value of 45 to the field, Paradox
stores the first 45 characters in the table. It stores the whole memo field in another file (with the extension .MB) and retrieves
it as you scroll through the records of the table.
6. Not available in Paradox 3.5 tables.
Tip If all your memos are smaller than a given size (for example, 200 characters), you can
save space and time by setting the memo field size to be equal to or larger than this
given size. You’ll still have an .MB file, but Paradox won’t have to access it to display the
field’s data.
Defining keys
To create a key, display the Create Table (page 19) or the Restructure Table (page 48)
dialog box. Then move to the Key column in the Field Roster and double-click (or press
any key). The key field indicator (*) appears. Database Desktop keys the table on the
selected field.
Remember these rules when defining keys:
• A table can have only one primary key. This key can be made up of one or more
fields.
• If a key is defined as a single field, that field must be the first field in the Field Roster.
• If you identify more than one field as keyed, you create a composite key. These fields,
taken as a group, must be unique for each record of the table. The composite key
must be the first fields in the Field Roster.
Tip You can always move a field to a different position in the Field Roster to create the
field arrangement you want. See page 21.
Removing keys
To remove a key from a field or group of fields, move to the Key column in the Field
Roster and double-click (or press any key). Database Desktop removes the key, and the
key field indicator (*) disappears.
Picture patterns
A picture acts as a template that formats the value you enter in a field. For example, if
you specify the picture (###)###-#### (a common template for U.S. phone numbers) and
enter the value 4085551234, Database Desktop formats the value into (408)555-1234.
Table 3.4 describes the characters you can use in a picture.
Table 3.4 Picture pattern characters
Character Stands for
# Any numeric digit
? Any letter (case-insensitive)
& Any letter (convert to uppercase)
@ Any character (case-insensitive)
! Any character (convert to uppercase)
; The next character is literal, not a special picture-string character
* The next character can be repeated any number of times. Or specify how many
occurrences of the next letter to require.
[] Characters inside brackets are grouped
{} Characters inside braces are grouped
, Alternative values
When you use the Picture Assistance dialog box, you can
• Type a custom picture pattern in the Picture edit field.
• Choose Verify Syntax to test the picture you type in the Picture edit field.
• Choose Restore Original to undo any changes you’ve made to the contents of the
Picture edit field.
• Type a value in the Sample Value edit field and choose Test Value to verify that the
picture in the Picture edit field works correctly.
• Click the Sample Pictures drop-down arrow to view the sample pictures. Database
Desktop displays an explanation of the picture in the panel above the Sample
Pictures drop-down list.
• Choose Add To List to place the contents of the Picture edit field on the Sample
Pictures drop-down list.
• Choose Delete From List to remove the selected picture from the Sample Pictures
drop-down list.
3 Choose the lookup table from the Lookup Table list. (All tables in the working
directory are shown.) The first field of the table you choose appears in the Lookup
Field edit field.
4 From the Fields list, choose the field that will look to the lookup table. Database
Desktop places it in the Field Name edit field.
5 Choose the lookup options you want.
6 Choose OK to close the Table Lookup dialog box. The name of the lookup table
appears below the Define button in the Create Table (or Restructure Table) dialog
box.
Note You can use a table lookup across different directories. Use the Path drop-down list or
the Browse button.
Lookup options
A Paradox table can be assigned one of two types of table lookups, as follows:
• Just Current Field checks values you enter in the current field against the values in
the first field of the lookup table. If the value is invalid, an error message appears and
the value is not entered into the table.
• All Corresponding Fields does what Just Current Field does, and also fills in values
from corresponding fields in the lookup table. Corresponding fields must have
identical field names and compatible field types in both tables.
Each type of table lookup has two options, as follows:
• Fill No Help keeps the lookup table from appearing, so you can’t display the lookup
table and select an entry from it.
• Help and Fill lets you view the lookup table from the table you’re editing, by
pressing Ctrl+Spacebar or choosing Record|Lookup Help.
The Fields list displays the fields you can use as a secondary index. BLOB fields are
dimmed.
3 Double-click the field on which you want to create the secondary index (or select it,
and then choose the Add Field arrow or press Alt+A). Database Desktop moves the
field to the Indexed Fields list.
4 Check any options you want. Index options are discussed later in this section.
5 Choose OK to create a secondary index on the field and close the dialog box.
Database Desktop automatically names case-sensitive indexes you create on a single
field with the field’s name. To create another secondary index, choose Define
again.
You can establish referential integrity only between like fields that contain matching
values. For example, you can establish referential integrity between Customer and Orders
on their CustomerNo fields. In both cases, the values contained in the specified fields are
the same. The field names don’t matter as long as the field types and sizes are identical.
Note You can establish referential integrity only between tables in the same directory.
Using referential integrity, Database Desktop checks the validity of a value before
accepting it in the referential integrity table. If you establish referential integrity between
3 Type the password you want in the Master Password edit field. You’ll see asterisks
(*) representing the characters you type. A password can be from 1 to 31 characters
long and can contain spaces. Passwords are case sensitive.
4 Type the same password in the Verify Master Password edit field. Again, you’ll see
asterisks in place of the characters you type.
5 If the two passwords aren’t identical (including capitalization), you’ll see an error
message prompting you to enter the password again.
6 Choose OK to close the dialog box and return to the Create Table dialog box.
Database Desktop saves the password when you choose OK from either the Password
Security or the Auxiliary Passwords dialog box.
If you want more specific security, you can choose Auxiliary Passwords from the
Password Security dialog box. You’ll see the Auxiliary Passwords dialog box, shown in
Figure 3.5.
Use this dialog box to assign specific table and field rights to specific auxiliary
passwords.
Note You can return to the Password Security dialog box and change the table’s master
password by choosing Cancel or pressing Esc. If you do this, any auxiliary passwords
you’ve specified are lost.
Table rights
The master password provides all rights to the table and its fields. Using auxiliary
passwords, you can be more selective and specific about the kind of table operations
each user can perform.
• All gives a user all rights to any function of the table, including the ability to
restructure or delete it. The only operation prohibited is a change to the master
password.
• Insert & Delete gives a user the right to insert or delete records or empty the table,
but not to delete the table.
• Data Entry gives a user the right to insert records in the table, but not to delete
records, restructure, or empty the table.
• Update gives a user the right to view the table and change non-key fields, but not to
insert or delete records or change key fields.
• Read Only gives a user the right to view the table, but not to change it in any way.
Field rights
In addition to specifying rights for the table as a whole, you can assign rights to
individual fields. The default option in the Field Rights list is All. To choose another
option, double-click the field (or choose the Field Rights button).
Double-click once to choose Read Only. Double-click again to choose None. If you
double-click again, the field right is reset to All.
Using passwords
When you try to open a password-protected table, Database Desktop prompts you for
the password. You must enter the password to open the table.
Suppose you close the table, then attempt to open it again. If you haven’t exited
Database Desktop, you’ll be allowed to open the table without giving the password
another time. Database Desktop stores the password and assumes you’re allowed to
open the table again. Database Desktop releases all passwords when you exit the
program.
If you want to release a password without exiting Database Desktop, choose Utilities|
Passwords. You’ll see the Enter Password(s) dialog box, shown in Figure 3.6.
Enter the password you want Database Desktop to release from memory in the
Password text box. Asterisks (*) represent the characters you type. Choose Remove to
remove this password from Database Desktop memory. You’ll be required to supply
the password the next time you open the table.
Tip You can choose Remove All to remove all passwords from Database Desktop memory.
This means any table you’ve opened using a password, then closed, will again be
protected. (Tables that are still open are not affected.)
If you’ve assigned the same password to several tables, you can use the Enter
Password(s) dialog box to give Database Desktop the password once to access all
applicable tables. Type the password and choose Add or OK (or press Enter).
If you’re saving a restructured table, check to add the data from the
restructured table to the newly created table.
Check to open the newly created table after saving it.
Type the table’s name in the New File Name edit field. You don’t need to type an
extension; Database Desktop recognizes the type of file you want based on the table
type you chose in the Table Type dialog box.
Unless you specify otherwise, Database Desktop saves the table to the working
directory. Use the Drive drop-down list if you want to save the table to an aliased
directory. If you want to save the table to a directory that isn’t available from the Drive
drop-down list, type the full path you want, with the table name, in the New File Name
edit field.
If you check the Display Table check box, Database Desktop opens the new table when
the Create Table dialog box is closed.
For information on valid field types for your SQL server, search for “field types” in the
keyword list in Database Desktop Help, and choose the topic for your server.
For SQL servers that do not support case-insensitive or descending indexes; the
Descending and Case Sensitive fields are dimmed.
You can include the table name with the index name or omit it:
• If you type the index name following “<table>_”, Database Desktop prefixes the
index name with the table name and an underscore.
• If you delete “<table>_”, Database Desktop omits the table name from the index
name. If the index name is not unique, an error will occur when Database Desktop
saves the table.
This index naming scheme also affects restructuring, as described in “Restructuring a
SQL table” on page 53.
Borrow options
In addition to borrowing the structure of a table, you can also borrow its primary or
secondary indexes, validity check definitions, referential integrity, table lookup
definitions, or any combination of these options. Use the Options panel to check the
definitions you want to borrow with the table.
If you are borrowing from a table of a different driver type, Database Desktop borrows
the indexes when possible.
Database Desktop borrows validity checks into Paradox tables when possible. For
example, if you borrow from a SQL table into a Paradox table and the SQL table has a
required field, Database Desktop borrows the required validity check into the Paradox
table.
Note Restructuring sometimes results in the creation of temporary tables, such as a Problems
table, that Database Desktop uses to store records that are incompatible with the table as
you’ve restructured it. Database Desktop numbers these temporary tables consecutively
(up to 99) and stores them in your private directory. For example, if you restructure
twice, and both operations cause data loss, Database Desktop creates both a Problems
and a Problem1 table.
Shortening a field
When you shorten a field that already has data in it, you might lose some data. When
this is the case, Database Desktop displays the Restructure Warning dialog box (see
Figure 3.11), which lets you choose whether to trim existing data, or to save records that
contain data too long for the new field size in the Problems table.
From N ✓ ✓ ✓ P ✓ ✓ ✓ ✓4
From $ ✓ ✓ ✓ ✓ ✓ ✓ ✓
From D ✓ ✓ ✓
From S ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓4
From M ✓ ✓ ✓ ✓
From F ✓ ✓ ✓
From B ✓
From G ✓ ✓
From O ✓ ✓
From L ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓4
From I ✓ ✓ ✓ ✓ ✓ ✓ ✓
From T ✓ ✓ ✓
From @ ✓ ✓ ✓ ✓
From # ✓ ✓ ✓ ✓ ✓ ✓ ✓
From + ✓ ✓ ✓ ✓ ✓ ✓ ✓ ✓
From Y ✓ ✓
1. ✓ means Database Desktop allows the conversion, but might trim data. If Database Desktop must trim data, you’ll see the
Restructure Warning dialog box, which asks you to confirm the conversion.
2. P means the conversion is allowed, but might generate the Problems table.
3. Blank means the field type conversion is not allowed.
4. Conversion to autoincrement is allowed only from a single-field key containing data that is <2147483647.
Note When you use a SQL table in Database Desktop, the table should have a unique index. If
it does not have a unique index and you edit the table’s data, you cannot view the edits
as you are making them. To add a unique index, click Define Index.
Use the Table Properties drop-down list to view information about the table.
• Validity Checks shows each field’s defined validity checks. Move through the fields
in the Field Roster to see each one’s validity checks.
• Table Lookup shows any tables that this table uses as a lookup table.
• Secondary Indexes shows all the table’s secondary indexes.
• Referential Integrity shows whether this table refers to a parent table for valid data.
• Table Language shows the table’s language driver.
• Dependent Tables shows any table that this table recognizes as a child in a
referential integrity relationship.
Choose Done to close the Structure Information dialog box when you’re finished
viewing the table’s structure.
Managing objects
Chapter 4
4
This chapter describes how to use the following commands on the Utilities menu to
manage your objects and tables:
• Sort
• Copy
• Rename
• Delete
Sorting a table
When you sort a table, you tell Database Desktop to rearrange the order of the records in
the table and display them in the order you specify.
SQL You cannot sort SQL tables.
The field is dimmed The Add The Remove Use these buttons to change
when you add it to Field arrow Field arrow the order of the fields in the
the Sort Order list Sort Order list.
Sorting on a network
When you sort tables in a multiuser environment, Database Desktop automatically
places a lock on the table you’re sorting. This means other users can’t modify the table’s
contents or structure. If another user has a lock on the table, you won’t be able to begin
sorting until that user finishes working with it.
When you sort to a new table, Database Desktop automatically places a lock on that
table as well as the original table for the duration of the sort.
Copying objects
You can copy tables, queries, SQL tables, and .SQL files from within Database Desktop.
Always use the Database Desktop Copy utility to copy Paradox or dBASE tables. Using
the DOS COPY command or the Windows File Manager may not copy all related files
that make up a table (for example, the files containing a table’s primary index,
secondary indexes, validity checks, or BLOB data). The Database Desktop Copy utility,
however, copies all files correctly.
All tables in your working and private directories are shown in the file list. Use the Type
drop-down list to display other object types.
You can use the Drive Or Alias drop-down list or the Directories panel to access files in
different directories.
When you copy a table, Database Desktop copies both its structure and the data
contained in it. Database Desktop also copies the table’s
• Key (primary index)
• Secondary index(es) (except .NDX files on dBASE tables)
• Validity checks (see “Copying referential integrity” on page 62)
• Table properties (as you’ve set them in the Table window)
When you copy a SQL table to a new table in the same database (alias) or to a different
database of the same type (such as InterBase to InterBase), Database Desktop copies
• The field structure exactly (including required field settings)
• Indexes, renaming them for uniqueness in the database as described in “Creating
indexes on SQL tables” on page 45 and “Prefixing the index name with the table
name” on page 54.
Copying on a network
When you copy a table, Database Desktop must acquire a read lock on the original table
and an exclusive lock on the copy. This means
• No user can change the contents or the structure of the table you’re copying during
the Copy operation.
• If you copy to an existing table, no locks can be open on that table.
If a record lock, write lock, or exclusive lock exists on the table you’re copying, you
won’t be able to make the copy until the lock is removed.
Note If the new dBASE table contains no production index (.MDX file), no float number field
type, and no memo field type, Database Desktop creates a dBASE III+ table. If the
1. Paradox assumes the data in the dBASE memo is in text form. If the memo contains a different type of data,
you should use the Add utility and add the memo to the appropriate Paradox BLOB field type.
Index conversions
Whenever possible, Database Desktop copies indexes when you change table types.
Database Desktop chooses the closest matching index type for the destination table. For
example:
• When copying from a SQL table to a Paradox table, only one unique index can be
copied, so Database Desktop copies the primary index. Unique indexes on the SQL
table become secondary indexes on the new Paradox table.
• dBASE expression indexes cannot be copied.
Renaming objects
You can rename tables, queries, and .SQL files from within Database Desktop. You
cannot rename SQL tables.
Always use the Database Desktop Rename utility to rename tables. Using the DOS
RENAME command or the Windows File Manager may not rename all related files that
make up a table (for example, the files containing a table’s primary index, secondary
indexes, validity checks, or BLOB data). The Database Desktop Rename utility,
however, renames all files correctly.
To rename an object, choose Utilities|Rename. Database Desktop opens the Rename
dialog box, shown in Figure 4.4.
If you’re renaming a table, you can open it after the rename operation completes
Use the Type drop-down list to display other object types in the file list
All tables in your working and private directories are shown in the file list. Use the Type
drop-down list to display other object types in the file list.
You can use the Directories panel to access files in different directories.
Enter the name of the object you want to delete in the Delete File text box. Choose OK to
delete it. Database Desktop displays a message asking you to confirm the deletion.
SQL To delete a SQL table, select the alias associated with the SQL server, then either select or
type the table name.
To delete more than one object, hold Shift and click the names of the objects you want to
delete.
Note You cannot delete a table that is identified as the parent in a referential integrity
relationship. You must first either delete the referential integrity (from the child table),
empty the child table, or delete the child table.
Caution Be careful when deleting objects. You can’t undo a deletion. Be sure that a table isn’t
used in any queries before you delete. Queries that depend on the table are not deleted
when the table is deleted.
Viewing tables
To open a table, choose File|Open|Table. Or, if the application window is empty, click
the Open Table button in the Toolbar. In the Open Table dialog box, choose the table to
open. The table you chose opens in a Table window, and the Toolbar appears as shown
in the following figure.
Figure 5.1 The Table window Toolbar
Previous Next Last Edit
Copy Restructure Set Record Record Data
When you first open a table, its data appears in a Table window in View mode. The data
appears in column and row format and displays any formatting properties included in
the file. Each Table window contains an independent view of a table, so different views
of a single table can be open at the same time. Up to 24 tables can be open at one time.
When you position the pointer over As you drag, the pointer changes
the scroll lock triangle, it changes to to two arrows.
a double-headed arrow.
Resizing rows
To resize the height of all of the rows in a table, drag the line under the first record
number. Move the line up to decrease the row height, or down to increase the row
height.
Editing data
To change data in a table, you must be in Edit mode. To enter Edit mode, do one of the
following:
• Click the Edit Data button in the Toolbar.
• Choose View|Edit Data.
i • Press F9.
In Edit mode, you can select any field and begin typing to replace its existing entry.
When you enter Edit mode, the Edit Data button remains pressed in and the status line
tells you Edit mode is active (as shown in the next figure).
Note In Database Desktop you cannot edit data in the following field types:
• Paradox: Memo, Formatted Memo, Graphic, OLE, Autoincrement, Binary, or Bytes
• dBASE: Memo, OLE, or Binary
• SQL: any BLOB (binary large object) field or a text field that allows more than 255
characters
To enter or edit data in these field types, use Paradox for Windows or dBASE, or an
application that supports editing those field types.
Note To position the insertion point within the entry so you can change a spelling or typing
error, use field view (see the next section).
Field view
In Edit mode, you can change a field’s entry in one of two ways:
Note In Edit mode, you can paste a value into a field only when its data type matches the field
type. For a list of field types, see the tables starting on page 23.
Using Undo
In Edit mode, edits are posted (saved in the table) as soon as you move off a record. To
discard any edits and restore the original record, choose Edit|Undo or Record|Cancel
Changes before moving off of the record.
After the original record is restored, a message in the status line lets you know the
changes were discarded.
To discard changes to a single field value and restore the original field entry, press Esc
before you move off the field.
Caution You cannot use Edit|Undo or Record|Cancel Changes to retrieve a Paradox record
you’ve deleted (but you can retrieve a dBASE record, if you have dBASE).
Field types
When you work with tables, you enter and edit data in a variety of field types. A field
type determines the kind of data you can enter in a field. Field types and possible values
are listed in Table 3.1 for Paradox tables and in Table 3.2 for dBASE tables.
In Database Desktop you cannot enter data in any of the following field types:
• Paradox: Memo, Formatted Memo, Graphic, OLE, Autoincrement, Binary, or Bytes
• dBASE: Memo, OLE, or Binary
• SQL: any BLOB (binary large object) field or a text field that allows more than 255
characters
Locking records
In Edit mode, as soon as you begin editing a record, Database Desktop locks it. When a
record is locked, other users can view it, but can’t edit it or delete it. A message in the
status line lets you know when a lock is active. Database Desktop removes the lock and
posts, or saves, the record as soon as you move off the record or turn off Edit mode.
Adding on a network
When you use Add, Database Desktop must acquire a read lock on the source table and
a write lock on the table you add the records to. This means other users can’t
• Change the contents or structure of either table
Subtracting records
You can remove records that exist in one table from a different table by using the
Subtract utility. You can subtract records only from a keyed table.
Because the table you subtract records from must be keyed, and dBASE and SQL tables
do not support Paradox keys, you cannot subtract records from dBASE or SQL tables.
Instead, use a DELETE query (see Chapter 7).
SQL You cannot use a SQL table as the source of a Subtract operation.
During a subtract operation, Database Desktop removes any record that contains a
value in its key field that exactly matches the value in the corresponding field of a record
in the subtraction table.
To subtract records, choose Utilities|Subtract. Database Desktop opens the Subtract
dialog box, shown in Figure 5.6.
Figure 5.6 The Subtract dialog box
Enter the table that contains the records
matching those you want to subtract
Subtracting on a network
When you use Subtract, Database Desktop must acquire a read lock on the table that
contains the records you’re subtracting, and a write lock on the table you’re subtracting
records from. This means other users can’t
• Change the contents or structure of either table
• Perform any operation that requires a write or exclusive lock on either table
If another user has locked a record or placed a write or exclusive lock on either table,
you must wait until the lock is removed before using Subtract.
Emptying tables
Use the Empty utility to remove all records from a table, leaving the table’s structure
(including all keys, indexes, validity checks, and so on) intact. You can use Empty on
Paradox, dBASE, and SQL tables.
To empty a table, choose Utilities|Empty. Database Desktop opens the Empty dialog
box, shown in Figure 5.7.
All tables in your working and private directories are shown in the list of files on the left.
You can use the Directories panel to access files in different directories.
Enter the name of the table you want to empty in the Empty Table text box. When you
choose OK, Database Desktop asks you to confirm the Empty operation. Choose Yes to
remove all records from the table.
To empty more than one table, hold Shift and click the names of the tables you want to
empty. When you choose OK, Database Desktop asks you to confirm the Empty
operation for each table you selected.
Note You cannot empty a table that is the parent in a referential integrity relationship. You
must first either delete the referential integrity (from the child table) or delete the child
table.
Note When you perform an Empty operation on a dBASE table, all records in the table are
marked as deleted.
If you execute a SELECT statement in the SQL Editor, Database Desktop displays the
resulting data in an Answer table, as shown in Figure 6.2.
Figure 6.2 The SQL Editor and an Answer table
To do this Do this
Enter (and execute) a new SQL statement Choose File|New|SQL Statement
Or right-click the Open SQL Script Toolbar button and choose New
Open (and edit or execute) an existing .SQL file Choose File|Open|SQL Statement
Or click the Open SQL Script Toolbar button
Or right-click the Open SQL Script Toolbar button and choose Open
View the SQL equivalent of an open QBE query Choose Query|Show SQL
Or click the Open SQL Script Toolbar button
Specifying an alias
Before running a SQL statement, you must specify the alias that the statement will run
against. To specify an alias, do one of the following:
• Choose SQL|Select Alias.
• Click the Select Alias Toolbar button.
Database Desktop opens the Select Alias dialog box, where you can choose one of the
aliases you created in the Alias Manager dialog box.
Figure 6.4 The Select Alias dialog box
Command Description
Find Search for strings of text in your code.
You can also use the Search button on the Toolbar.
Find Next Search for the next occurrence of the text you specified using Find. Find Next is
dimmed if you have not searched for anything in this session.
You can also use the Search Next button on the Toolbar.
If your SQL statement is a query, the query results are displayed in an Answer table, as
shown in Figure 6.2 on page 88.
QBE query in a
Query window
SQL equivalent in
the SQL Editor
Note If the SQL database does not support an equivalent SQL statement for a QBE query, a
message confirms that the query is processing in the QBE environment. For further
information, see your Borland SQL Link Getting Started manual.
For detailed information on constructing QBE queries, see Chapter 7.
For more information about queries on SQL tables, search for “SQL queries” in the
keyword list in Database Desktop Help, and choose the topic “Using QBE to query SQL
data.”
Arranging tables
You can use the View menu to arrange the tables (query images) in a Query window:
• Tile Tables is the default; the tables or query images appear one below the other.
• Cascade Tables displays the tables or query images as individual, stacked windows.
Removing tables
1 Click the Remove Table button or choose Query|Remove Table.
2 In the Remove Table dialog box, select the table name to remove.
3 Choose OK.
Placing checkmarks
1 To place a checkmark in a single field, position the pointer on its check box and hold
down the left mouse button.
2 Drag the pointer to select the checkmark you want, then release the mouse button.
As a shortcut, click the check box to place a Check in a field.
To remove a checkmark, click the check box.
Tip To place the same checkmark in every field in a table, use the check box below the table
name and select the checkmark you want.
Up-arrow
button
Down-arrow
button
3 Select a field to sort the Answer table by, from the Available Fields list.
4 Choose the right-arrow button to move the field to the Sort By list.
5 Repeat steps 3 and 4, adding the fields in the order you want the Answer table
sorted by.
6 To remove a field from the Sort By list, select it, then choose the left-arrow button.
7 To rearrange the order of the fields in the Sort By list, select a field and then use the
up- or down-arrow buttons to move it up or down in the list.
8 When you finish, choose OK.
9 Run the query.
Note If a query is undefined or has syntax errors, the Sort Answer dialog box is unavailable.
Including punctuation
To include punctuation marks and other reserved characters in a query statement,
enclose the value in double quotation marks (" "). Quotation marks identify characters as
literal characters instead of as part of a reserved word or operator.
Blank spaces in values don’t need to be enclosed in quote marks.
For quotation marks and backslash characters to appear in the Answer table, precede
them with a backslash (\).
Table 7.3 Using backslash (\) characters
Character Example of use
" Literal quotation marks in the value must be preceded by a backslash (\). For example,
when you type "Thomas E. \"Ned\" Lawrence", Thomas E. “Ned” Lawrence appears in the
Answer table.
Backslash (\) Literal backslash (\) characters in the value must be preceded by another backslash (\\).
Editing queries
Editing queries is similar to editing table values, except there is no Edit Data button or
corresponding Edit mode.
For example, to find records in the sample BOOKORD.DB table with ordered quantities
of 20 or more, place a Check in the Quant field, then type >=20. (A space between the
operator and the number is optional.)
Ranges of values with upper and lower limits can be specified by combining
comparison operators with other operators, such as the AND (,) operator (see page 111).
Note In general, all lines must have checkmarks in the same fields for this kind of query to
work.
Deleting lines
1 Select the line you want to delete.
wr 2 Press Ctrl+Del to remove it from the query image.
Note Ctrl+Del deletes the line and any query statements in it, and cannot be undone.
Note The name, or label, of an example element has no relation to the value it represents. To
remind yourself of the values an example element represents, use a meaningful name.
In the above figure, EGall represents all values in the field, EGsubset represents a
subset of values, and ConCredit represents the amount of credit for the customer
named Connors.
In the City field is an example element named SimCity, which could represent all cities
in that field if no other selection conditions were in the query image. However, the
customer name Simpson in the Last Name field defines SimCity as the city where that
particular customer is based. Below the line that defines SimCity is another line that has
Checks in the fields that will appear in the Answer table.
Note Fields with example elements don’t have to be checkmarked if you don’t want to see
them in the Answer table. In the previous figure, any of the fields in the second line could
have been checkmarked.
This query uses an example element to represent the date the item M27 was ordered.
The arithmetic expression calculates the date 30 days after the order, and the < (less
than) operator selects the records prior to that calculated date.
When you enter example elements in multi-line, multi-table queries, be sure to join the
corresponding lines in the query images. For example, note the Checks on the lines in
the previous figure.
Asking questions about multiple tables is similar to asking questions about a single
table. You can use the OR operator when you want to set alternative conditions in the
same field. Do this as if you were working with a single table.
As with single tables, when you use the OR operator in different fields of a multi-table
query, or define more than one set of OR conditions, you must enter them on separate
lines of the query image.
Note When a query has multiple lines and multiple tables, unique example elements must be
used for an OR operation across multiple lines. These example elements must also be
placed on separate lines in the other tables, as shown in the following figure.
Combining calculations
Because example elements represent values, you can use them to perform calculations
on the values they represent. This means instead of separately locating values and
performing calculations on the results, you can do it in a single query with example
elements.
For example, look at the following figure. To increase the amount of credit for each
customer in the Customer table, you can use an example element and the multiplication
operator (*). You could phrase this in English as “Multiply all current credit amounts by
Tip To show the calculated increase in the credit amount without the existing credit amount,
omit the Check in the Credit field.
Note You can use INSERT, DELETE, and CHANGETO only in these field types:
• Paradox: Alpha, Number, Money, Short, Long Integer, BCD, Date, Time, Timestamp,
and Logical
• dBASE: Character, Float, Number, Date, and Logical
If a problem occurs while a query is inserting, deleting, or changing records, the data is
saved in temporary tables called ERRORINS.DB, ERRORDEL.DB, or ERRORCHG.DB,
respectively. If you’re querying a dBASE file, these files are saved with the .DBF
extension instead.
Inserting records
Unlike other kinds of queries, the values you type into query statements in an INSERT
query are expressions that create new values; they do not select records.
In an INSERT query, if you don’t want a field to appear in the target table, you omit a
query statement in that field. After the query is run, fields in the target table remain
blank if fields in the source table are blank (don’t have query statements).
When you add data from a source table to a target table, the entire table structure
doesn’t have to match, just the fields with query conditions.
If the target table is not keyed, records from the source table are inserted at the end of
the target table. If the target table is keyed, the records are inserted in key sort order. If
any records in the source table have the same key value as existing records in the target
table, the records are not inserted. Instead, they appear in a Keyviol table, another type of
temporary table. (Multiple key violation tables are named Keyviol1, Keyviol2, and so on.)
Note Do not place checkmarks in any fields in an INSERT query; checkmarks cause an error
and the query won’t run.
Deleting records
Although in Edit mode you can choose Record|Delete (or press Ctrl+Del) to remove the
selected record from a table, a DELETE query is faster when there are multiple records
that are similar enough to meet a set of selection conditions.
Caution If you don’t enter any selection conditions in a DELETE query, all records will be deleted
from the table.
Modifying records
To modify records in a table, you can create and run a CHANGETO query. A single
CHANGETO query can define a calculation and write the new values resulting from the
calculation. After the query is run, a temporary table named Changed appears. Changed
contains a copy of the original records (before the query was run).
SQL The Changed table is not created when you run a CHANGETO query on a SQL table.
Notice that the records in the Changed table are sorted in the order they were processed. For
example, the first line of the query changed the records of all customers whose credit
rating was under $1,000,000, so these records appear first.
Tip To override default grouping in a CALC operation, you can add either the reserved
word ALL or UNIQUE to the query statement.
The Customer and Bookord tables are joined using example elements in a common field.
The Check in the City field of Customer groups the records by city, and displays the city
names (which match the selection condition) in the Answer table. The selection condition
average >=10 averages the number of orders for each city and selects those cities with ten
or more orders.
Tip To make each Quant value in the group appear in the Answer table, place a Check in the
Quant field of this query. (This also causes the records to be grouped by Quant, in
addition to City.)
Note In a Set query (discussed on page 135), to calculate the average of all values in a field,
type calc average in the field. This expression creates a new field in the Answer table,
called Average of FieldName, where FieldName is the name of the field in which you
type the expression.
The Check in the City field of Customer groups the records by city and makes the cities
that match the selection condition appear in the Answer table. The selection condition
count >=2 counts all orders in each city, then selects the groups that have a count of two
or more.
The Check in the City field of Customer groups the records by city and displays in the
Answer table the cities that match the selection condition. The selection condition max
<=1000000 finds the credit limit for each city and selects those with $1,000,000 or less.
The Check in the Last Name field of Customer groups the records by customer name and
displays in the Answer table those names that match the selection condition sum>=5. This
expression totals the quantities ordered by each customer, then selects those with
quantities of five or more.
Tip To use this query to display duplicate customer names, place a Check in the Quant field.
The quantities per order as well as the customer name will appear in the Answer table.
Although Bookord has 128 records with order details, the CALC COUNT operation
returns a count of 22 because many customers have made multiple purchases (these
duplicate values are ignored).
The Check in the State field creates five groups of records, one for each state value that
matches the selection condition CA or WA or M.. . The values that match the expression
calc min as Smallest Orders appear in the Answer table in a new field named Smallest
Orders. Note that checkmarks are not used to display the minimum values.
The Checks in Vol and Emp # group the orders based on both of these fields. The AS
operator clarifies the contents of the calculated field by assigning it a name in the Answer
table. In the Answer table, each volume displays the number of orders taken by a
particular salesperson.
Using sets
Set operations are useful for revealing trends and patterns in data with a single query.
A set is a type of group—a specific group of records about which you intend to ask
further questions. Once you’ve defined a set in a query, there are two kinds of
comparisons you can make:
• To other groups of records. The set comparison operators (ONLY, NO, EVERY, and
EXACTLY) are used to compare other groups of records to the set. For example, you
can ask
To use any of these set comparison operators, first define the set. On another line of the
query image, type the name of the operators followed by the set name, as shown in the
following two examples:
Defining a set
1 Click the New Query button in the Toolbar.
2 Add the table(s) you want to query.
3 To create a Set query, click the menu under the table name in the Query window,
then choose Set.
4 To define the set, place a unique example element in each field you want to select.
5 To refine the set further, enter any selection condition(s) that specify the records to be
included in the set.
6 To join fields in multiple tables, use matching example elements.
Comparing a set
1 To compare the defined set to records in another table, create selection conditions in
the other table.
2 To list the query results of any field, place a checkmark in the field.
3 Run the query.
Tip To group the records by a field, without displaying that field in the Answer table, use the
GroupBy check instead of a checkmark (see page 139).
The pair of Join1 example elements links the lines in the Volumes and Bookord tables. In
the Volumes table, the Set reserved word in the leftmost field and the selection condition
in the Category field defines a set of books that contains either Meals or Sports
titles.
In Bookord, the Check in the Cust field groups the orders by customer. The ONLY
operator in the Vol field matches those records of customers who have ordered only
books included in the set. Customers who have ordered books from any other series
aren’t listed in the Answer table.
The first line in the query image defines the set of Meals books and their prices. Notice
that the Set reserved word appears in the leftmost field of the query image.
After the set of titles is defined with the Volumes query image, the EVERY operator is
used to compare orders with the set. This operator selects groups that include orders for
every member of the set. Customers who have also ordered books from other categories
might also appear in the Answer table.
The GroupBy check groups the records by customer, but does not show the Cust ID
field in the Answer table.
The inclusion operator in the Customer table identifies it as the master table. All customer
records in the master table that meet the selection condition R.. or S.. appear in the
Answer table. The Bookord table is the lookup table; it supplies any corresponding values
for records in Customer.
Because only three customers have placed orders, the order records for Raymond,
Samuelson, Simpson, Smith, and Svenvald are blank.
Tip To see the difference in the results, try creating and running this query, then delete the !
operator and run the query again. The second Answer table will display only those
customer records that match a record in Bookord (there won’t be any blank order values).
The multiple ! operators in this query make all book titles appear in the Answer table—
even if an order hasn’t been placed by a sales representative.
The ! operators in the Bookord query image ensure that the Answer table contains all
values in both the Vol and Quant fields (volumes as well as all orders).
The two tables are linked by two pairs of example elements, JoinVol and Inventory.
Because there is no ! operator in the Volumes table, the volume ID, title, and number of
items in stock are retrieved only for records that exceed the selection condition
>.25*Inventory.
The best way to learn the file syntax is to save your queries, then open them in a text
editor and experiment by revising them. For example, to change the sort order of a
checked field from ascending to descending, replace the word Check with
CheckDescending. To see the results, run the modified query, then study the difference.
Once you learn the .QBE file syntax, you can create queries directly in a text editor. The
following sections describe the syntax of .QBE files.
Tip Notice how easy it is to read the query text in the above figure when the columns line
up. To duplicate this method, set the font property for the block to Courier, a
nonproportional font.
When you query a dBASE table to create an Answer table in Paradox format, Database
Desktop translates dBASE field types to Paradox field types. Table 7.15 shows what to
expect when you query a dBASE table to a Paradox Answer table.
Table 7.15 Querying a dBASE table to a Paradox Answer table
From dBASE table To Paradox Answer table Side effects
Character Alpha
Float Number Removes size
Number Number Removes size
Date Date
Logical Logical
Memo Memo Adds size (1)1
OLE OLE
Binary Graphic
Keyboard techniques
The following techniques can be used as alternatives to the mouse operations described
earlier in the manual:
• To select multiple fields across rows and columns in the Table window, hold down
the Shift key while you press arrow keys. Fields selected this way must be contiguous.
• To change the order of columns, select a column, then press Ctrl+R. The selected
column moves to the last position in the table, and all columns to the right of the
selected column shift left by one position.
Function keys
The following table lists all actions that can be performed with the function keys, alone
and in combination with other keys.
Table A.2 Function key actions
Key(s) Action in table Action in query
F1 Help Help
F2 Field view Field view
Ctrl+F2 Persistent field view Persistent field view
F3 Super back tab Up Image (if more than one query image exists in an active
Query window)
F4 Super tab Down Image (if more than one query image exists in an active
Query window)
F5 Lock record Create an example element
Shift+F5 Commit record and unlock
Ctrl+F5 Post/Keep Locked
F6 Lookup help Place a Check or clear any type of checkmark (toggle on/off)
Shift+F6 Select option in check menu (repeatedly pressing this key
combination cycles through the different options)
F8 Run the current query
F9 Enter/exit Edit mode
Super tab
Super tabs let you jump from one multi-region area to another in query images.
Table A.3 Using Super tab
Key Action Description
F4 Super tab In a query with multiple tables, moves downward to the next table in the
Query window. When the active query image is at the bottom of the window,
the next one selected is the query image at the top of the window.
F3 Super back tab Moves in a reverse direction to Super tab, otherwise works identically.
Ctrl+letter shortcuts
The next table shows the operations you can perform in a Table window with Ctrl+letter
and Ctrl+Shift+letter combinations.
Table A.4 Ctrl+letter shortcut combinations
Keys Action in Table window
Ctrl+C Copy
Ctrl+D Ditto (repeat last entry)
Ctrl+F Field view
Ctrl+L Lock record
Ctrl+Shift+L Commit record
Ctrl+R Rotate columns
Ctrl+V Paste in Edit mode
Ctrl+X Delete selected text in Edit mode
Ctrl+Spacebar Lookup value
Ctrl+Shift+Spacebar Multi-field lookup
Index
Symbols Answer Table command
Properties menu 99, 101
Auxiliary Passwords option 40
Auxiliary tables
! (inclusion) operator 140–144 Answer tables 99–101 queries 97
multiple 142 changing data formats 99, AVERAGE operator (group
"Fast" queries 101 summary) 129
Queries 97 checkmarks 116 averaging groups 129
* (asterisk), key field indicator 26 closing for different
+ operator
alphanumeric values 122
queries 96
dBASE 147
B
date values 108 defined 7 backslash characters, query
, (AND) operator 111 duplicate records 105 statements 103
.. (wildcard) operator 109 example elements 114 beeps, warning 85
= operator 106 group statistics, binary fields 24
@ (wildcard) operator 109 calculating 132–135 binary large objects 25
\ (backslash), query properties 100 blank fields 19
statements 103 .QBE file, definition in 145 BLANK operator 108
| (pipe) in .QBE file 146 renaming 99, 101 blanks
fields 112, 121 (spaces) in values 103
table in query block 145
A saving under another
values, finding 107, 108
BOOKORD.DB (sample table) 4
access rights 39 name 145 Borrow button 47
assigning 41 single records 105
Borrow Table Structure dialog
combining 42 sorting 100
defaults 99 box 47
field 41–42 borrowing a table’s structure 46
table 41 ANSWER section, .QBE files 145
ANSWER.TV files 100 building tables 18, 19, 22, 46
activating Database Desktop 9 bytes fields 24
Add command, Utilities ANSWER.TVF files 100
menu 79 application window 9–11
Add dialog box 79 Toolbars 10 C
adding arithmetic operations CALC operator
fields 20, 50 ! (inclusion) operator and 143 calculations and example
key fields 27, 49, 51 See also calculations elements 121
records 79–82 date values and 108 group statistics,
aliases arithmetic operators 112 calculating 132–135
defined 14 Arrange Icons command, calculations
Aliases command, File menu 14 Window menu 10 See also arithmetic operations
All Corresponding Fields arranging tables 95 alphanumeric values and 122
lookup 32 AS operator 112 CALC and example
ALL operator (group ascending sort order elements, combining 121
summary) 133 (default) 95, 99 date values and 108
All option (field rights) 42 ASCII files (.QBE) 98 fields, with example elements
All option (table rights) 41 ASCII sort order 129 and 117
alpha fields 23, 50 Assist button (pictures) 29 groups, performing on 132
changing to date fields 52 asterisk (*), key field indicator 26 queries 121
converting data to 52 asymmetrical outer joins 142 calendar, computer 107, 108
alphanumeric values, at-sign (@), wildcard Cancel Changes command,
combining 122 operator 109 Record menu 76
alternative sort orders 33 auxiliary passwords 40, 41 Cascade command, Window
AND operator (,) 111 creating 42 menu 10
ANSI character set 33 Auxiliary Passwords dialog Cascade option (Referential
Answer Sort command box 40 Integrity) 38
Properties menu 99, 100 Passwords list 42 Cascade Tables command
Index 153
Copyright © 1994, Borland International. All rights reserved. BORLAND CONFIDENTIAL
December 19, 1994 1:59 pm (i:\delphi\delphi\cd_rom\cdbooks\dduser\qpwddg.ix)
Index 155
Copyright © 1994, Borland International. All rights reserved. BORLAND CONFIDENTIAL
December 19, 1994 1:59 pm (i:\delphi\delphi\cd_rom\cdbooks\dduser\qpwddg.ix)
Index 157
Copyright © 1994, Borland International. All rights reserved. BORLAND CONFIDENTIAL
December 19, 1994 1:59 pm (i:\delphi\delphi\cd_rom\cdbooks\dduser\qpwddg.ix)
OEM character set, translating in OR operator 111 picture validity checks 29, 30
Database Desktop 33 order, sort See sort order placement mode (for example
OLE fields 24, 26 organizing data 17–18 elements) 115
ONLY operator (set outer joins (defined) 142 placing checkmarks 96
comparison) 136 plus sign (operator)
Open command, File menu 11, P alphanumeric values 122
69 date values 108
Open Table button 18, 69 Paradox pointers
operators 102 compatibility 31, 38, 52 columns and 72
! (inclusion) 140–144 indexes 11 customizing Table view 71
multiple 142 OEM character set hot zones and 72
+, alphanumeric values translation 33 multiple selection and 74
and 122 parent tables 36, 37 rows and 72
, (AND) 111 parentheses (for setting scroll lock and 71
.. (wildcard) 109 precedence) 112 Post/Keep Locked command
= (equal to) 106 pass-through SQL See SQL Record menu 78
@ (wildcard) 109 Editor posting
ALL (group summary) 133 Password Security dialog edits to a table 76
AND box 40, 41 precedence
example elements and 115 Auxiliary Passwords checkmarks 104
arithmetic (table of) 108, 113 option 40 operators 112
AS 112 Password Security option 40 Previous command, Record
AVERAGE (group passwords 39–42 menu 70
summary) 129 case sensitivity 40 Previous Set command, Record
BLANK 108 changing 41, 42 menu 70
CALC 121, 132–135 creating 40, 42 primary indexes 11, 26
comparison 106 deleting 42 primary keys 5
COUNT (group naming 40 :PRIV: (private directory) 13
summary) 133 opening tables with 42 private directory 13
EVERY (set comparison) 140 removing 43 Private Directory command
EXACTLY (set Passwords command, Utilities File menu 13
comparison) 135 menu 42 Problems tables 49
inclusion (!) 140–144 Passwords list (Auxiliary
multiple 142 Prohibit option (Referential
Passwords) 42 Integrity) 38, 39
inexact 107 Paste command, Edit menu 76
LIKE 107 prohibiting auxiliary tables 97
Paste Link command, Edit properties
with example menu 76
elements 117 Answer table 99, 100, 101
MAX (group summary) 134 pasting Answer table, restoring 101
MIN (group summary) 134 links 76 Answer table, saving 100
NO (set comparison) 135 values 76 table 71–73
NOT 107 paths, aliases 14 default, restoring 73
with example patterns, matching characters Properties menu
elements 117 in 108 Answer Sort 99, 100
ONLY (set comparison) 136 persistent field view 75 Answer Table 99, 101
OR 111 PERSONAL.DB (sample file Delete 73
OR combined with AND 112 used in figure) 119 Restore 73
precedence of 112 phone numbers 23, 28 Save 72
set comparison (table of) 136 Picture Assistance dialog box 29, protecting
special 107, 111 30 fields 41
SUM (group summary) 129, Sample Pictures option 30 tables 41
132 Picture check box 29 punctuation in queries 102
summary (table of) 129 picture strings 28–30 .PX files (primary index) 11
table of 102 changing 30
TODAY 108 characters allowed 29 Q
UNIQUE (group creating 29
summary) 129 getting help 29 QBE (query by example)
wildcard 108, 109 See also queries
Index 159
Copyright © 1994, Borland International. All rights reserved. BORLAND CONFIDENTIAL
December 19, 1994 1:59 pm (i:\delphi\delphi\cd_rom\cdbooks\dduser\qpwddg.ix)
redefining secondary indexes 35 Restructure Warning dialog Select All command, Edit
referential integrity 36–39, 52 box 49 menu 74
changing 39 restructuring tables 46, 47–53 selecting
defined 36 language drivers and 50 columns, all values in 76
enforced 38 SQL 54 fields 74
lookup tables vs. 31 reversing an action See undoing multiple fields, keys for 149
relationships, naming 39 rows records 74
returning information on 55 removing 77 tables, all values in 76
settings, saving 38 resizing 72 selection conditions 101
specifying 37–38 See also lines (in query images) example elements and 116,
updating tables 38 running queries 119
Referential Integrity dialog networks 97 group queries and 134
box 37 multiple 111
Cascade option 38
Prohibit option 38, 39
S reversing with NOT 107
single line and 109, 110
Strict Referential Integrity Sample Pictures option (Picture server (DDE) 8
option 38 Assistance) 30 set comparison operators (table
Referential Integrity option 37, Save As button 43, 53 of) 136
55 Save As command, File menu 13 set queries 135
relational tables, defined 4 Save button 53 comparison operators 136
relationships, multi-table 31 Save command short fields 23
Remove Field arrow 37 File menu 13 converting data to 52
removing Properties menu 72 shortcut keys
field values 77 Save Index As dialog box 35 keypad combinations (table
fields 19 Save Referential Integrity As of) 152
records 77 dialog box 38 single records 105
tables 95 Save Table As dialog box 43, 44 small tables 18
Rename command, Utilities Display Table option 44 Sort command, Utilities
menu 64 saving 43 menu 57
Rename dialog box 64 referential integrity sort order 5, 43
renaming settings 38 Answer tables and 99, 100
fields 20, 21, 50 tables 43–44 ascending (default) 95, 99
objects 64–65 tables, to different ASCII 129
tables 64–65 directories 44 descending 96
reordering fields 19 values See posting overriding 33
repeating fields 17 scientific notation 107 .QBE files and 146
repositioning fields 19 scroll bars, tables 70 queries 100
required fields 28 scroll locks Sort Table dialog box 58
reserved symbols (table of) 102 defined 71 sorting
reserved words placing 71 objects 57–60
CALC 121 scrolling tables 57–60
table of 102 columns 70 sound (binary fields) 24
table operations (table of) 124 display record numbers 70 source tables
resizing search and replace adding from 124
column headings 72 CHANGETO, similarity example elements and 125
fields 49, 50 to 123–124, 127 special operators 107
Restore command searching See queries specifying
Properties menu 73 secondary indexes 11, 33–36 field types 22
Restore Original button 30 composite 34, 35 referential integrity 37–38
Restore Original option (Picture creating 34, 35 validity checks 28
Assistance) 30 deleting 36 SQL
restoring records 76 maintaining 34 copying tables 61
Restructure command 48 naming 35 creating new files 13
Restructure Table dialog box 46, redefining 35 creating tables 44
48 returning information on 55 field types 26
Secondary Indexes option 34, 55 files 15
indexes 27, 45, 46, 54
Index 161
Copyright © 1994, Borland International. All rights reserved. BORLAND CONFIDENTIAL
January 22, 1995 11:22 am (i:\delphi\delphi\cd_rom\cdbooks\dduser\qpwddg.ix)
Y
.Ynn files (composite secondary
index) 11
.Ynn files (secondary index) 11
Index 163
User’s Guide
®
Borland
Ve r s i o n 5 . 1 Database Desktop
Borland International, Inc., 100 Borland Way
P.O. Box 660001, Scotts Valley, CA 95067-0001
Borland may have patents and/or pending patent applications covering subject matter in this document. The
furnishing of this document does not give you any license to these patents.
COPYRIGHT © 1992, 1995 Borland International, Inc. All rights reserved. All Borland product names are trademarks
or registered trademarks of Borland International, Inc. Other brand and product names are trademarks or registered
trademarks of their respective holders.
1E0R195
9495969798-987654321
W1
Copyright © 1994, Borland International. All rights reserved. BORLAND CONFIDENTIAL
December 19, 1994 1:59 pm (h:\paradox\dbdesk5\ddg\qpwddg.toc)
Contents
Introduction 1 Defining fields . . . . . . . . . . . . . . . . . . . 20
Field names . . . . . . . . . . . . . . . . . . . . 20
Inside this manual . . . . . . . . . . . . . . . . . . 1 Rules governing Paradox field names . . . 20
Conventions . . . . . . . . . . . . . . . . . . . . . . 2 Rules governing dBASE field names . . . . 21
Using this book . . . . . . . . . . . . . . . . . . . . 2 Rules governing SQL field names . . . . . 21
To delete a field . . . . . . . . . . . . . . . . . . 21
Chapter 1 To insert a field . . . . . . . . . . . . . . . . . . 21
Database concepts 3 To edit a field name . . . . . . . . . . . . . . . 21
To reorder fields . . . . . . . . . . . . . . . . . 22
Understanding tables . . . . . . . . . . . . . . . . 3 Specifying field type. . . . . . . . . . . . . . . . 22
Relational tables. . . . . . . . . . . . . . . . . . . .4 Paradox field types and sizes . . . . . . . . . . 22
Using indexes . . . . . . . . . . . . . . . . . . . . . 4 BLOB fields . . . . . . . . . . . . . . . . . . . . 25
Paradox primary indexes . . . . . . . . . . . . . .5 Valid dBASE field types . . . . . . . . . . . . . 25
Paradox secondary indexes . . . . . . . . . . . . .5 Valid SQL field types . . . . . . . . . . . . . . 26
dBASE indexes . . . . . . . . . . . . . . . . . . . .5 Keys in Paradox tables . . . . . . . . . . . . . . 26
Querying databases . . . . . . . . . . . . . . . . . 6 Defining keys . . . . . . . . . . . . . . . . . . . 26
Query by example . . . . . . . . . . . . . . . . . .6 Removing keys . . . . . . . . . . . . . . . . . . 27
Answer tables. . . . . . . . . . . . . . . . . . . . 7 A dBASE table’s index . . . . . . . . . . . . . . 27
SQL queries . . . . . . . . . . . . . . . . . . . . . 7 An SQL table’s index . . . . . . . . . . . . . . . 27
Using DDE links . . . . . . . . . . . . . . . . . . . 8 Specifying validity checks . . . . . . . . . . . . 28
Picture patterns . . . . . . . . . . . . . . . . . . 28
Chapter 2 Getting assistance with pictures. . . . . . . 29
Viewing a field’s validity checks . . . . . . . . 30
The Database Desktop window 9 Removing a validity check . . . . . . . . . . . 31
Starting Database Desktop . . . . . . . . . . . . . 9 Creating table lookup . . . . . . . . . . . . . . . 31
The Database Desktop window . . . . . . . . . . 9 The difference between table lookup and
referential integrity . . . . . . . . . . . . . . . 31
The application window Toolbar . . . . . . . . 10
Why use table lookup?. . . . . . . . . . . . . . 31
Arranging windows . . . . . . . . . . . . . . . . 10
Lookup options . . . . . . . . . . . . . . . . . . 32
Managing files. . . . . . . . . . . . . . . . . . . . 11 Defining secondary indexes . . . . . . . . . . . 33
Opening files . . . . . . . . . . . . . . . . . . . . 11 The Maintained option . . . . . . . . . . . . . 34
The Drive (or Alias) list . . . . . . . . . . . . . 12 The Case Sensitive option . . . . . . . . . . . . 35
The File Type list . . . . . . . . . . . . . . . . . 12 Composite secondary indexes . . . . . . . . . 35
Tables with passwords . . . . . . . . . . . . . 12 Modifying secondary indexes . . . . . . . . . 35
Creating new files . . . . . . . . . . . . . . . . . 12 Erasing secondary indexes . . . . . . . . . . . 36
Saving files. . . . . . . . . . . . . . . . . . . . . . 13 Defining referential integrity. . . . . . . . . . . 36
Setting up a working directory . . . . . . . . . . 13 Update Rule options . . . . . . . . . . . . . . . 38
Setting up a private directory. . . . . . . . . . . 13 Using Strict Referential Integrity . . . . . . . . 38
Aliases . . . . . . . . . . . . . . . . . . . . . . . . 14 Saving the referential integrity relationship . 38
Creating an alias . . . . . . . . . . . . . . . . . 14 Changing or deleting referential integrity . . 39
Changing an alias definition . . . . . . . . . . 15 Creating self-referential integrity. . . . . . . . 39
Removing an alias . . . . . . . . . . . . . . . . 15 Establishing password security . . . . . . . . . 39
.SQL files . . . . . . . . . . . . . . . . . . . . . . . 15 Table rights . . . . . . . . . . . . . . . . . . . . 41
Field rights. . . . . . . . . . . . . . . . . . . . . 41
Chapter 3 Using passwords . . . . . . . . . . . . . . . . . 42
Creating tables 17 Choosing a table language . . . . . . . . . . . . 43
Saving the new table . . . . . . . . . . . . . . . 43
Planning tables . . . . . . . . . . . . . . . . . . . 17
Creating an SQL table . . . . . . . . . . . . . . . 44
Paradox, dBASE, or SQL table?. . . . . . . . . . 18 Creating indexes on SQL tables . . . . . . . . 45
Creating a new table . . . . . . . . . . . . . . . . 18 Naming SQL indexes . . . . . . . . . . . . . . 46
Guidelines for creating tables . . . . . . . . . . . 19 Borrowing a table structure . . . . . . . . . . . . 46
Creating a simple Paradox table . . . . . . . . 20 Borrow options. . . . . . . . . . . . . . . . . . . 47
i
Copyright © 1994, Borland International. All rights reserved. BORLAND CONFIDENTIAL
December 19, 1994 1:59 pm (h:\paradox\dbdesk5\ddg\qpwddg.toc)
ii
Copyright © 1994, Borland International. All rights reserved. BORLAND CONFIDENTIAL
December 19, 1994 1:59 pm (h:\paradox\dbdesk5\ddg\qpwddg.toc)
iii
Copyright © 1994, Borland International. All rights reserved. BORLAND CONFIDENTIAL
December 19, 1994 1:59 pm (h:\paradox\dbdesk5\ddg\qpwddg.toc)
Appendix A
Using the keyboard 149
Keyboard techniques. . . . . . . . . . . . . . . 149
Data entry shortcuts . . . . . . . . . . . . . . . 149
Function keys . . . . . . . . . . . . . . . . . . . 150
Super tab . . . . . . . . . . . . . . . . . . . . . . 151
Keyboard shortcuts for table operations . . . 151
Ctrl+letter shortcuts. . . . . . . . . . . . . . . . 151
Keypad shortcut keys . . . . . . . . . . . . . . 152
iv
Copyright © 1994, Borland International. All rights reserved. BORLAND CONFIDENTIAL
December 19, 1994 1:59 pm (h:\paradox\dbdesk5\ddg\qpwddg.lot)
Tables
2.1 File extensions . . . . . . . . . . . . . . . . . . . 11 7.6 Arithmetic operations on dates . . . . . . . . 108
3.1 Paradox field types . . . . . . . . . . . . . . . . 23 7.7 The .. wildcard operator . . . . . . . . . . . . 109
3.2 dBASE field types. . . . . . . . . . . . . . . . . 25 7.8 The @ wildcard operator . . . . . . . . . . . . 109
3.3 Paradox validity checks . . . . . . . . . . . . . 28 7.9 Arithmetic operators . . . . . . . . . . . . . . 113
3.4 Picture pattern characters . . . . . . . . . . . . 29 7.10 Reserved words for table operations . . . . . 123
3.5 Lookup types and options. . . . . . . . . . . . 33 7.11 Types of summary operators . . . . . . . . . 129
3.6 Auxiliary password field and table rights . . 42 7.12 Combining summary operators with CALC 133
3.7 Changing field types in Paradox tables . . . . 51 7.13 Set operators . . . . . . . . . . . . . . . . . . . 136
3.8 Converting strings to dates . . . . . . . . . . . 52 7.14 Querying a Paradox table to a dBASE Answer
4.1 Copying from a Paradox to a dBASE table. . 63 table . . . . . . . . . . . . . . . . . . . . . . . . 147
4.2 Copying from a dBASE to a Paradox table. . 64 7.15 Querying a dBASE table to a Paradox Answer
5.1 Cut, copy, and paste operation commands. . 76 table . . . . . . . . . . . . . . . . . . . . . . . . 148
7.1 Checkmark types . . . . . . . . . . . . . . . . . 95 A.1 Data entry shortcut keys . . . . . . . . . . . . 149
7.2 Reserved symbols and words, and query A.2 Function key actions . . . . . . . . . . . . . . 150
operators . . . . . . . . . . . . . . . . . . . . . 102 A.3 Using Super tab . . . . . . . . . . . . . . . . . 151
7.3 Using backslash (\) characters . . . . . . . . 103 A.4 Ctrl+letter shortcut combinations . . . . . . . . 151
7.4 Checkmark precedence . . . . . . . . . . . . 104 A.5 Keypad combinations. . . . . . . . . . . . . . 152
7.5 Comparison operators . . . . . . . . . . . . . 106
v
Copyright © 1994, Borland International. All rights reserved. BORLAND CONFIDENTIAL
January 23, 1995 12:14 pm (h:\paradox\dbdesk5\ddg\qpwddg.lof)
Figures
1.1 A table . . . . . . . . . . . . . . . . . . . . . . . . 4 7.9 Combining example elements with
1.2 A query and its results . . . . . . . . . . . . . . . 7 operators . . . . . . . . . . . . . . . . . . . . . 117
2.1 The Database Desktop application window . 10 7.10 Example elements and dates. . . . . . . . . . 118
2.2 Application window Toolbar. . . . . . . . . . 10 7.11 Example elements used to join tables . . . . 119
2.3 The Alias Manager dialog box . . . . . . . . . 14 7.12 A multi-line, multi-table query . . . . . . . . 120
3.1 The Create Table dialog box . . . . . . . . . . 19 7.13 Example elements on multiple lines . . . . . 121
3.2 The Picture Assistance dialog box . . . . . . . 29 7.14 A simple example element. . . . . . . . . . . 122
3.3 Changing a secondary index . . . . . . . . . . 36 7.15 Using CALC to concatenate values. . . . . . 123
3.4 Referential integrity . . . . . . . . . . . . . . . 36 7.16 Inserting records into a target table. . . . . . 125
3.5 The Auxiliary Passwords dialog box . . . . . 41 7.17 Deleting records with a DELETE query . . . 127
3.6 The Enter Password(s) dialog box . . . . . . . 43 7.18 CHANGETO with multiple example
3.7 The Save Table As dialog box. . . . . . . . . . 44 elements . . . . . . . . . . . . . . . . . . . . . . 128
3.8 The Create Table dialog box for 7.19 A sample AVERAGE query . . . . . . . . . . 130
SQL tables . . . . . . . . . . . . . . . . . . . . . 45 7.20 A sample COUNT query. . . . . . . . . . . . 131
3.9 The Define Index dialog box for 7.21 A sample MAX query. . . . . . . . . . . . . . 131
SQL indexes . . . . . . . . . . . . . . . . . . . . 45 7.22 A sample SUM query . . . . . . . . . . . . . . 132
3.10 The Restructure table dialog box. . . . . . . . 48 7.23 An example query using CALC COUNT . . 133
3.11 The Restructure Warning dialog box . . . . . 49 7.24 An example query using CALC COUNT
3.12 The Restructure Table dialog box for ALL. . . . . . . . . . . . . . . . . . . . . . . . . 134
SQL tables . . . . . . . . . . . . . . . . . . . . . 54 7.25 A sample query using CALC MIN . . . . . . 134
3.13 The Structure Information dialog box. . . . . 55 7.26 Multiple fields in a group query . . . . . . . 135
3.14 The Structure Information dialog box for 7.27 A sample Set query . . . . . . . . . . . . . . . 138
SQL tables . . . . . . . . . . . . . . . . . . . . . 56 7.28 A two-line Set query definition . . . . . . . . 138
4.1 The Sort Table dialog box . . . . . . . . . . . . 58 7.29 Joining another table to a set query. . . . . . 139
4.2 The Copy dialog box . . . . . . . . . . . . . . . 61 7.30 A Set query using the GroupBy check . . . . 140
4.3 Copying to or from an SQL table. . . . . . . . 62 7.31 Using the inclusion operator ! . . . . . . . . . 141
4.4 The Rename dialog box . . . . . . . . . . . . . 65 7.32 The ! operator in Customer . . . . . . . . . . 142
4.5 The Delete dialog box . . . . . . . . . . . . . . 66 7.33 The ! operator in Bookord . . . . . . . . . . . 142
5.1 The Table window Toolbar . . . . . . . . . . . 69 7.34 Multiple ! operators in a query . . . . . . . . 143
5.2 A scroll lock in the Table window . . . . . . . 71 7.35 A query using the ! operator in an
5.3 Hot zone pointers in the Table window . . . 72 expression. . . . . . . . . . . . . . . . . . . . . 144
5.4 The Customer table in Edit mode . . . . . . . . 74 7.36 A query and its .QBE file . . . . . . . . . . . . 145
5.5 The Add dialog box . . . . . . . . . . . . . . . 80 7.37 A query for an Answer table in
5.6 The Subtract dialog box . . . . . . . . . . . . . 83 dBASE format . . . . . . . . . . . . . . . . . . 147
5.7 The Empty dialog box . . . . . . . . . . . . . . 84
6.1 The SQL Editor . . . . . . . . . . . . . . . . . . 88
6.2 The SQL Editor and an Answer table . . . . . 88
6.3 SQL Editor Toolbar. . . . . . . . . . . . . . . . 88
6.4 The Select Alias dialog box . . . . . . . . . . . 89
6.5 SQL statement in the SQL Editor. . . . . . . . 90
6.6 SQL translation of a QBE query . . . . . . . . 91
7.1 The Query window Toolbar . . . . . . . . . . 94
7.2 The Query Options dialog box . . . . . . . . . 97
7.3 The Sort Answer dialog box . . . . . . . . . 100
7.4 Multiple lines in a query image. . . . . . . . 110
7.5 Combined OR and AND operations . . . . 112
7.6 Example elements in single-table queries. . 114
7.7 Using an example element to match
a specific value . . . . . . . . . . . . . . . . . 116
7.8 An example element for a range of values . 117
vi