setResults()

variable.SetResults(variable [, variable...])

This method is used with a variable of the PREPARED data type to change the output values produced by the prepared statement. This method can be called either for the PREPARED variable, or for the CURSOR variable, if the PREPARED variable was used for this cursor. It is typically used for a prepared SELECT statement which has no INTO clause to specify where the retrieved values should be placed.

Usage

This method accepts a number or arguments. Their number, order and data types depend on the values returned by the prepared statement and must match.

You can call the SetResults() method for the PREPARED variable, if this variable is then used independently of any cursor. If you use this variable in the Declare() method to associate the prepared statement with a cursor, you need to execute the SetResults() method for the CURSOR variable declared by this method and not for the PREPARED variable.

An example method call:

CALL prep_v.Prepare("SELECT fname, lname, age FORM customers") -- selects 3 values

CALL prep_v.SetResults(r_fname, r_lname, r_age) -- provides the location for them