Creating Database Queries

Use these procedures as a general guideline for creating database queries through the Query Builder that retrieve data from Lawson application files. When creating database queries, you can use the following application data objects to define the query:

Object Description
Data area The data area or data ID that contains the data you want to query.
System code System codes are subsets of the product line, and contain the files you want to query. To select a file, you must expand the list of system codes and then expand the specific system code that contains the file you want to query.
File Files contain the data you want to query.
Field Fields represent the individual types of data within a file.
Related field Related fields are fields from files that have a one-to-one or one-to-many relation with the query's primary file. They allow you to include fields from more than one file in a query.

You can also control the data in the query or enhance the performance of the query by using conditions, indexes, filters, and command properties.

Feature Description
Filter Filters are rules you can define in the Query Builder to control what data will be included in a query. Adding a Filter to a Query
Condition Conditions are rules defined for the file that limit what data will be included. To find out the precise definition of a condition, use the Database Definition utility (dbdef). Adding a Condition to a Database Query
Index Indexes are ways to access and order records in a file. If you do not specify an index in the query, the query uses the primary index to retrieve records (usually, xxxSET1). To see the order and names of the fields in an index, expand Fields under the name of the index. Any existing conditions for the index are also shown under the name of the index. Adding an Index to a Query
Command properties Command properties are various special parameters for a command. Modifying Database Query Command Properties