The Query Builder.

Top  Previous  Next

The "Query Builder" can be found on the Second Page of the CaveBase. It makes it easy to create query statements through a simple point-and-click process.

 

QueryBuilder

 

Statements. The core of the Query Builder is the statement box. The Query Builder has two statement boxes. They are labeled the “First Statement” and the “Second Statement”.

 

Statement Elements. Each statement box contains three edit boxes that allow you to enter each element of your statement.You can type the values directly into each box, or you can click on the button to the left of each box to have the program enter the values for you. Here is a detailed description of each box:

 

1. The Field Box. The first box is called the "field" box and holds the name of the database field you want to test. If you already know the name, you can just type it in. You can also select from a list of available fields in the upper left corner of the page. Just select one of the fields from the list and then press the button to left of the "field" box. This will fill put the selected field name in the box.

 

2. The Operator Box. The second box holds a mathematical symbol that is used to compare the database Field with the Target.  This box is called the "operator" box. You can type a symbol directly into the box or you can select a list of symbols at the top of the page. Just select one of the six operators at the top of the page and press the button to the left of the operator box.

 

3. The Target Box. Third box holds the "target" value you are trying to match. The Target values must match the data type of the Field.  For example, if the Field is a string then the Target must also be a string. To make it easier to enter values into the Target Box, there is a set of Target values at the top of the window. Just select one of the values and press the button to the left of the Target Box. Here is a list of the common preset values you can use.

 

a. True/False. These values are used to match boolean fields. Select "True" if you wish to search for data where the target is present and "False" if you wish to search for data where the target is absent.

 

b. Field. This option puts the currently highlighted fieldname from the list of fields into the target box. Use this options when your are trying to compare two separate feature fields in the database.

 

c. Date. This option allows you to enter the numerical value of a date into the target box. With some database engines, the date is encoded as the number of days since 01/01/0001. To make it easier to calculate the date value, there is date box that allows you to select a date and then have it entered in the field. To do this, use the up and down buttons to select a date, select the "Date" option as the "Target", and then click the "Target Button."

 

d. Null. A null value occurs in a database when there is no value entered into a field. You can use Null to search for fields where no data has been entered. You can also use it to exclude data where no value has been entered.

 

e. Quotes.. CaveBase automatically puts quotes around strings however, some databases require quotes around other Target values. Enabling the “Quotes” option causes CaveBase to put quotes are each target.