#mobile-application-10-DerbyApp-build-iphone-Classes-PlausibleDatabase-PLPreparedStatement.h / h
An object that represents a pre-compiled statement, and any parameters bound to that statement. @par SQL Parameters Literal query values may be substituted via parameter binding, by using the '?' symbol in the query statement and PLPreparedStatement::bindParameters. Additionally, PLPreparedStatement::bindParameterDictionary implements name-based parameter binding. To bind named parameters, use the ':<name>' syntax. All named parameters must be provided in the binding parameter dictionary, and it is not possible to mix named and unnamed parameters when using PLPreparedStatement::bindParameterDictionary. @par Thread Safety PLPreparedStatement instances implement no locking and must not be shared between threads without external synchronization. @warning A prepared statement may not be re-used by simultaneous PLResultSet. Attempting to either re-execute a statement or rebind its parameters without first closing any PLResultSet previously returned by the statement will throw an exception.
Returns the number of parameters in the prepared statement.
Bind a list of parameters to the prepared statement. All parameters must be provided -- if less than PLPreparedStatement::parameterCount values are provided, an exception will be thrown.
parameter: parameters List of parameters to bind. @note NSArray may not contain nil values. Any nil parameter values must be supplied using NSNull.
If a statement was created using named parameters, the parameter values may be bound using a dictionary mapping the parameter name to its intended value.
parameter: parameters Dictionary of named parameters to bind. @note NSDictionary may not contain nil values. Any nil parameter values must be supplied using NSNull.
Execute an update, returning YES on success, NO on failure.
Execute an update, returning YES on success, NO on failure.
parameter: outError A pointer to an NSError object variable. If an error occurs, this pointer will contain an error object indicating why the statement could not be executed. If no error occurs, this parameter will be left unmodified. You may specify nil for this parameter, and no error information will be provided.
Execute a query, returning a PLResultSet.
returns: PLResultSet on success, or nil on failure.
Execute a query, returning a PLResultSet.
parameter: outError A pointer to an NSError object variable. If an error occurs, this pointer will contain an error object indicating why the statement could not be executed. If no error occurs, this parameter will be left unmodified. You may specify nil for this parameter, and no error information will be provided.
returns: PLResultSet on success, or nil on failure.
Close the prepared statement, and return any held database resources. After calling, no further PLPreparedStatement methods may be called on the instance. As PLPreparedStatement objects may be placed into autorelease pools with indeterminate release of database resources, this method may be used to ensure that resources are free'd in a timely fashion. Failure to call close will not result in any memory leaks.
(C) Æliens 04/09/2009
You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.