|
6 |
If the stored procedure returns a recordset, test it if you want by entering a value in the Default Value column in the Variables box and clicking Test. |
|
UltraDev runs the stored procedure and displays the recordset, if any. In the above example, passing a default value of 100 to the stored procedure generates the following recordset:
|
|
|
After you close the dialog box, UltraDev inserts ASP code in your page that, when run on the server, creates a command object that runs a stored procedure in the database. The stored procedure in turn performs a database operation, such as generating a recordset or inserting a record.
By default, the code sets the Prepared property of the Command object to True, which makes the application server reuse a single compiled version of the object every time the stored procedure is run. If you know the command will be executed more than a few times, having a single compiled version of the object can improve the efficiency of database operations. However, if the command will only be executed one or two times, using one might actually slow down your Web application because the system has to pause to compile the command. To change the setting, switch to Code view and change the Prepared property to False.
Note: Not all database providers support prepared commands. If your database does not support it, you might get an error message when you run the page. Switch to Code view and change the Prepared property to False. .
If the stored procedure generates a recordset, the procedure will appear in UltraDev in both the Server Behaviors panel and the Data Bindings panel (Window > Data Bindings). Use the Data Bindings panel to display the recordset's content on your page by selecting a recordset column in the panel and dragging it to the page. UltraDev inserts code in the page that, when run on the server, displays the content of the column of one record.
If the stored procedure takes parameters, you might create a page that gathers the parameter values and submits them to the page with the stored procedure. For example, you may create a page that uses URL parameters or an HTML form to gather parameter values from users.
|