A SQL condition checks
information in an external database and retrieves drawing objects
that are linked to records that match the condition.
Example: If a database
table stores information on supplier, owner, and cost of furniture
in a set of drawings, you can define a query to show all chairs purchased
from a specific supplier.
Use a query with a
SQL condition to retrieve objects based on the value in a linked data
base record. In this example, all pads with a phase type of 'C'
are retrieved. Move your cursor over the image to see the results.
you are retrieving objects from attached drawings, you must have
the same data base attached in both the attached drawing and the
must link SQL data to objects before you can use a SQL query. For
more information about connecting to external databases and linking
records to objects in your drawings, see Setting Up Data Sources for Drawings and Overview of Linking Database Records to Objects.
Specifying a Value
The operator and the
value define the condition that the value in the table must match.
For example, if you select the operator < (less than) and enter
a value of 5, the condition retrieves all
objects linked to records in which the value in the table is less
- The value must match the data type of
the column. For example, if the column requires a name, enter a
- Enclose string values in single quotes.
If the string contains a single quotation mark, precede the single
quotation mark with a single quotation mark.
- For dates, use the format TIMESTAMP'YYYY-MM-DD
00:00:00', for example "Date" > TIMESTAMP`1990-05-30 11:45:00'
Because a SQL condition
relies on the ability to connect to a data source, the condition
will not work if any part of the connection is broken:
- The query must specify a valid link template.
- The data source must be attached and
- The data source must be in the same directory
as when you connected to it. (You must not have moved it after connecting.)
- Links must exist between drawing objects
and records in the specified data source.