Supplying parameters at design time

From InterBase

Go Up to Setting parameters


At design time, parameters in the SQL statement appear in the parameter collection editor. To access the TParam objects for the parameters, invoke the parameter collection editor, select a parameter, and access the TParam properties in the Object Inspector. If the SQL statement does not contain any parameters, no TParam objects are listed in the collection editor. You can only add parameters by writing them in the SQL statement.

To access parameters:

  1. Select the query component.
  2. Click on the ellipsis button for the Params property in Object Inspector.
  3. In the parameter collection editor, select a parameter.
  4. The TParam object for the selected parameter appears in the Object Inspector.
  5. Inspect and modify the properties for the TParam in the Object Inspector.

For queries that do not already contain parameters (the SQL property is empty or the existing SQL statement has no parameters), the list of parameters in the collection editor dialog is empty. If parameters are already defined for a query, then the parameter editor lists all existing parameters.

Note:
The TIBQuery component shares the TParam object and its collection editor with a number of different components. While the right-click context menu of the collection editor always contains the Add and Delete options, they are never enabled for TIBQuery parameters. The only way to add or delete TIBQuery parameters is in the SQL statement itself.

As each parameter in the collection editor is selected, the Object Inspector displays the properties and events for that parameter. Set the values for parameter properties and methods in the Object Inspector.

The DataType property lists the data type for the parameter selected in the editing dialog. Initially the type will be ftUnknown. You must set a data type for each parameter.

The ParamType property lists the type of parameter selected in the editing dialog. Initially the type will be ptUnknown. You must set a type for each parameter.

Use the Value property to specify a value for the selected parameter at design time. This is not mandatory when parameter values are supplied at runtime. In these cases, leave Value blank.

Advance To: