IBUpdateSQL and IBDataSet Editor dialog box

From RAD Studio
Jump to: navigation, search

Go Up to Database Dialog Boxes

Use the editor to create SQL statements for updating a dataset.

The TIBUpdateSQL object must be associated with a TIBQuery object by setting the TIBQuery property UpdateObject to the name of the TIBUpdateSQL object used to contain the SQL statements. A datasource and database name must be selected for the TIBQuery object. In addition, the SQL property must include an SQL statement defining a table.

To open the SQL editor:

  1. Select the TIBUpdateSQL or TIBDataSet object in the form.
  2. Right-click and choose Update SQL editor or DataSet editor.

The Update SQL editor has two pages, the Options page and the SQL page.

The Options page

The Options page is visible when you first invoke the editor.

Table Name

Use the Table Name combo box to select the table to update. When you specify a table name, the Key Fields and Update Fields list boxes are populated with available columns.

Key Fields

The Key Fields list box is used to specify the columns to use as keys during the update. Generally the columns you specify here should correspond to an existing index.

Update Fields

The Update Fields list box indicates which columns should be updated. When you first specify a table, all columns in the Update Fields list box are selected for inclusion. You can multi-select fields as desired.

Get Table Fields

Read the table fields for the table name entered and list the fields.

Dataset Defaults

Use this button to restore the default values of the associated dataset. This will cause all fields in the Key Fields list and the Update Fields list to be selected and the table name to be restored.

Select Primary Keys

Click the Primary Key button to select key fields based on the primary index for a table.

Generate SQL

After you specify a table, select key columns, and select update columns, click the Generate SQL button to generate the preliminary SQL statements to associate with the update component's ModifySQL, InsertSQL, DeleteSQL, and RefreshSQL properties.

Quote Identifiers

Check the box labeled Quote Field Names to specify that all field names in generated SQL be enclosed by quotation marks. This option is disabled at this time.



The SQL page

To view, modify, and refresh the generated SQL statements, select the SQL page. If you have generated SQL statements, then when you select this page, the statement for the ModifySQL property is already displayed in the SQL Text memo box. You can edit the statement in the box as desired.

Note: Note: Keep in mind that generated SQL statements are intended to be starting points for creating update statements. You may need to modify these statements to make them execute correctly. Test each of the statements directly yourself before accepting them.

Use the Statement Type radio buttons (Modify, Insert, Delete, or Refresh) to switch among generated SQL statements and edit them as desired.

To accept the statements and associate them with the update component's SQL properties, click OK.