Procedure property editor
Use the Procedure property editor to set properties associated with a
ProcedureDataSet or a
ProcedureProvider component. With an associated Database component, they allow execution of a stored procedure.
To display this property editor, choose the procedure property from the Inspector when a ProcedureDataSet component is selected in the Component Tree. The property values referenced in this dialog are stored in the ProcedureDescriptor object.
This property editor contains two pages:
For more information on stored procedures, see the About section for the ProcedureDataSet component in the JBCL Reference. For a tutorial on accessing data using stored procedures, see the
Obtaining data through a stored procedure
topic in the Database Application Developer's Guide.
Procedure page
Use the Procedure page to set procedure properties and associate the procedure with a particular Database.
The properties referenced on this page of the property editor are stored in the ProcedureDescriptor object.
Database
Displays the names of all instantiated Database objects to which this ProcedureDataSet can be bound. This property must be set for the stored procedure to run successfully.
Selecting a Database object enables the Browse Procedures button.
Browse Procedures
Displays the Available Procedures dialog which allows you to browse the database for existing procedures. The Available Procedures dialog displays a listbox with available procedure names, and a Paste Procedure button. Click the paste button to paste the procedure into the Stored Procedure Escape or SQL Statement field of this property editor.
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.
Stored Procedure Escape or SQL Statement
Enter either of the following in this field:
- A JDBC procedure escape sequence of the form:
{call PROCEDURENAME [(?,?,?,...)] } for procedures
{?= call FUNCTIONNAME[(?,?,?,...)] } for functions
Where the square brackets denote that the parameter list is optional.
- Some servers allow a separate syntax for procedure calls, for example, with Interbase:
execute procedure PROCEDURENAME ?,?,?
In both, the parameter markers (the "?" signs) may be replaced with named parameters of the form :ParameterName.
Execute Immediately When Opened
Determines whether the stored procedure executes automatically when the ProcedureDataSet is opened. This option defaults to checked, which allows live data to display in the UI Designer when the ProcedureDataSet is bound to a data-aware control. This option displays only when accessing this dialog through the procedure property of ProcedureDataSet or ProcedureProvider components.
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 ProcedureDataSet. The data can be loaded:
- all at once (in a single fetch operation).
- asynchronously using a new thread.
- as needed, for example, as you cursor through the data in a GridControl.
- one row at a time.
For more information on these options, see the JBCL Reference topic Load.
Test Procedure
Tests the value of the Stored Procedure Escape or SQL Statement field and other properties on this dialog against the specified Database. The result ("Success" or "Fail") is displayed below the Test Procedure button. This button displays only when accessing this dialog through the procedure property of ProcedureDataSet or ProcedureProvider components.
Parameters page
Use the Parameters page to specify parameters for your procedure 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 procedure parameters from the drop-down list.