Setting Parameter Information at Design Time
Go Up to Understanding Stored Procedure Parameters
You can invoke the StoredProc
parameter collection editor at design time to set up parameters and their values.
The parameter collection editor allows you to set up stored procedure parameters. If you set the Database
and StoredProcName
properties of the TIBStoredProc
component at design time, all existing parameters are listed in the collection editor. If you do not set both of these properties, no parameters are listed and you must add them manually. Additionally, some database types do not return all parameter information, like types. For these database systems, use the SQL Explorer utility to inspect the stored procedures, determine types, and then configure parameters through the collection editor and the Object Inspector. The steps to set up stored procedure parameters at design time are:
- Optionally set the
Database
andStoredProcName
properties. - In the Object Inspector, invoke the parameter collection editor by clicking on the ellipsis button in the
Params
field. - If the
Database
andStoredProcName
properties are not set, no parameters appear in the collection editor. Manually add parameter definitions by right-clicking within the collection editor and selecting Add from the context menu. - Select parameters individually in the collection editor to display their properties in the Object Inspector.
- If a type is not automatically specified for the
ParamType
property, select a parameter type (Input
,Output
,Input/Output
, orResult
) from the property’s drop-down list. - If a data type is not automatically specified for the
DataType
property, select a data type from the property’s drop-down list. - Use the
Value
property to optionally specify a starting value for an input or input/output parameter.
Right-clicking in the parameter collection editor invokes a context menu for operating on parameter definitions. Depending on whether any parameters are listed or selected, enabled options include: adding new parameters, deleting existing parameters, moving parameters up and down in the list, and selecting all listed parameters.
You can edit the definition for any TParam
you add, but the attributes of the TParam
objects you add must match the attributes of the parameters for the stored procedure on the server. To edit the TParam
for a parameter, select it in the parameter collection editor and edit its property values in the Object Inspector.
You can never set values for output and result parameters. These types of parameters have values set by the execution of the stored procedure.