Executes an SQL stored procedure by specifying its name and parameter array.
Syntax
void executeStoredProcedure(String storedProcedure, Vector storedProcParameters)
Parameters
Return values
None.
Exceptions
CwDBSQLException - If a database error occurs.
Notes
The executeStoredProcedure() method sends a call to the specified storedProcedure to the database associated with the current connection. This method sends the stored-procedure call as a prepared SQL statement; that is, the first time it executes, this stored-procedure call is sent as a string to the database, which compiles the string into an executable form (called a prepared statement), executes the SQL statement, and returns this prepared statement to executeStoredProcedure(). The executeStoredProcedure() method saves this prepared statement in memory.
To handle any data that the stored procedure returns, use the hasMoreRows() and nextRow() methods.
You can also use the executeSQL() or executePreparedSQL() method to execute a stored procedure as long as this stored procedure does not contain OUT parameters. If the stored procedure uses OUT parameters, you must use executeStoredProcedure() to execute it. Unlike with executeSQL() or executePreparedSQL(), you do not have to pass in the full SQL statement to execute the stored procedure. With executeStoredProcedure(), you need to pass in only the name of the stored procedure and a Vector parameter array of CwDBStoredProcedureParam objects. The executeStoredProcedure() method can determine the number of parameters from the storedProcParameters array and builds the calling statement for the stored procedure.
See also
executePreparedSQL(), executeSQL(), getDBConnection(), hasMoreRows(), nextRow()