Query property editor

Use the Query property editor to set the properties of a query when using the QueryDataSet or QueryProvider component.

This property editor contains two pages:

To display this property editor, choose the query property from the Inspector when a QueryDataSet component is highlighted in the Component Tree.


Query page

Use the Query page to set query properties and associate the query with a particular Database. The properties referenced on this page of the property editor are stored in the QueryDescriptor object.

Database

Displays the names of all instantiated Database objects to which this QueryDataSet can be bound. This property must be set for the query to run successfully.

Selecting a Database object enables the Browse Tables button. If the Database is connected to a Borland DataGateway URL, the SQL Builder button is also enabled.

SQL Builder

When you specify a database that is connected to a Borland DataGateway URL, click this button to display the SQL Builder dialog. The SQL Builder helps you set up your query statement. If you develop your query statement using the SQL Builder dialog, the query statement is displayed in the SQL Statement field.

This button is dimmed and unavailable while the Database field displays the value "<none>". Specify a Database that is connected to a Borland DataGateway URL to enable this button.

Browse Tables

Displays the Available Tables and Columns dialog. The Available Tables and Columns dialog displays a list of tables in the specified Database, and the columns in the selected table. The Paste Table and Paste Column buttons allow you to quickly create your query statement by pasting the name of the selected table (by clicking the Paste Table button) or selected column (by clicking the Paste Column) button into your query statement at the cursor's current (insertion) point.

This button is dimmed and unavailable while the Database field displays the value "<none>". Select a database object in the Database field to enable this button.

SQL Statement

The query statement to run against the Database specified in the Database drop-down list. Use the SQL Builder button to have JBuilder help create the SQL statement or use the Browse Tables button to quickly paste the selected table and column names into the query statement. Use the Browse Tables button to quickly paste the selected table and column names into the query statement.

This is a required property; you must specify a valid SQL statement. If the SQL statement does not return a result set, an exception is generated.

Place SQL text in resource bundle

Select this option to move the SQL statement to a ResourceBundle file. If this option is selected and you close this dialog using the OK button, the Create ResourceBundle dialog box displays to prompt you for the name of the Resource Bundle.

Load Options

Specifies how the data is loaded into the QueryDataSet. The data can be loaded: For more information on these options, see the JBCL Reference topic Load.

Test Query

Tests the SQL statement and other properties on this dialog against the specified Database. The result ("Success" or "Fail") is displayed below the Test Query button.


Parameters page

Use the Parameters page to specify parameters for your query statement.

Parameter values are specified through an instantiated ReadWriteRow object (or an instance of any of its subclasses), for example, a DataSet object.

Select the ReadWriteRow object (or the ReadWriteRow subclass) that contains the values for your query parameters from the drop-down list.