PreparedStatement Class Reference

Inherited by CallableStatement, OCI8PreparedStatement, PreparedStatementCommon, and SQLitePreparedStatement.

List of all members.

Public Member Functions


Member Function Documentation

& PreparedStatement::getConnection ()

 

Gets the db Connection that created this statement.

Returns Connection

Reimplemented in PreparedStatementCommon.

& PreparedStatement::getResource ()

 

Get the PHP native resource for the statement (if supported).

Returns resource

Reimplemented in PreparedStatementCommon, and MSSQLCallableStatement.

PreparedStatement::close ()

 

Free resources associated with this statement. Some drivers will need to implement this method to free database result resources.

Returns void

Reimplemented in PreparedStatementCommon, MSSQLCallableStatement, and OCI8PreparedStatement.

& PreparedStatement::getResultSet ()

 

Get result set. This assumes that the last thing done was an executeQuery() or an execute() with SELECT-type query.

Returns RestultSet Last ResultSet or null if not applicable.

Reimplemented in PreparedStatementCommon.

PreparedStatement::getMoreResults ()

 

Gets next result set (if this behavior is supported by driver). Some drivers (e.g. MSSQL) support returning multiple result sets -- e.g. from stored procedures.

This function also closes any current restult set.

Default behavior is for this function to return false. Driver-specific implementations of this class can override this method if they actually support multiple result sets.

Returns boolean True if there is another result set, otherwise false.

Reimplemented in PreparedStatementCommon, and MSSQLCallableStatement.

PreparedStatement::getUpdateCount ()

 

Get update count.

Returns int Number of records affected, or null if not applicable.

Reimplemented in PreparedStatementCommon.

PreparedStatement::setLimit ( $  v)

 

Sets the maximum number of rows to return from db. This will affect the SQL if the RDBMS supports native LIMIT; if not, it will be emulated. Limit only applies to queries (not update sql).

Parameters:
int $v Maximum number of rows or 0 for all rows.

Returns void

Reimplemented in PreparedStatementCommon.

PreparedStatement::getLimit ()

 

Returns the maximum number of rows to return or 0 for all.

Returns int

Reimplemented in PreparedStatementCommon.

PreparedStatement::setOffset ( $  v)

 

Sets the start row. This will affect the SQL if the RDBMS supports native OFFSET; if not, it will be emulated. Offset only applies to queries (not update) and only is evaluated when LIMIT is set!

Parameters:
int $v

Returns void

Reimplemented in PreparedStatementCommon.

PreparedStatement::getOffset ()

 

Returns the start row. Offset only applies when Limit is set!

Returns int

Reimplemented in PreparedStatementCommon.

& PreparedStatement::executeQuery ( $  p1 = null,  $  fetchmode = null )

 

Executes the SQL query in this PreparedStatement object and returns the resultset generated by the query. We support two signatures for this method:

Reimplemented in PreparedStatementCommon, MSSQLCallableStatement, and MSSQLPreparedStatement.

PreparedStatement::executeUpdate ( $  params = null)

 

Executes the SQL INSERT, UPDATE, or DELETE statement in this PreparedStatement object.

Parameters:
array $params Parameters that will be set using PreparedStatement::set() before query is executed.

Returns int Number of affected rows (or 0 for drivers that return nothing).

Exceptions:
SQLException if a database access error occurs.

Reimplemented in PreparedStatementCommon.

PreparedStatement::set ( $  paramIndex,  $  value )

 

A generic set method.

You can use this if you don't want to concern yourself with the details. It involves slightly more overhead than the specific settesr, since it grabs the PHP type to determine which method makes most sense.

Parameters:
int $paramIndex
mixed $value

Returns void

Exceptions:
SQLException 

Reimplemented in PreparedStatementCommon.

PreparedStatement::setArray ( $  paramIndex,  $  value )

 

Sets an array. Unless a driver-specific method is used, this means simply serializing the passed parameter and storing it as a string.

Parameters:
int $paramIndex
array $value

Returns void

Reimplemented in PreparedStatementCommon, and PgSQLPreparedStatement.

PreparedStatement::setBoolean ( $  paramIndex,  $  value )

 

Sets a boolean value. Default behavior is true = 1, false = 0.

Parameters:
int $paramIndex
boolean $value

Returns void

Reimplemented in PreparedStatementCommon, and PgSQLPreparedStatement.

PreparedStatement::setBlob ( $  paramIndex,  $  blob )

 

Parameters:
int $paramIndex
mixed $blob Blob object or string containing data.

Returns void

Reimplemented in PreparedStatementCommon, MSSQLPreparedStatement, PgSQLPreparedStatement, and SQLitePreparedStatement.

PreparedStatement::setClob ( $  paramIndex,  $  clob )

 

Parameters:
int $paramIndex
mixed $clob Clob object or string containing data.

Returns void

Reimplemented in PreparedStatementCommon, and OCI8PreparedStatement.

PreparedStatement::setDate ( $  paramIndex,  $  value )

 

Parameters:
int $paramIndex
string $value

Returns void

Reimplemented in PreparedStatementCommon.

PreparedStatement::setFloat ( $  paramIndex,  $  value )

 

Parameters:
int $paramIndex
float $value

Returns void

Reimplemented in PreparedStatementCommon.

PreparedStatement::setInt ( $  paramIndex,  $  value )

 

Parameters:
int $paramIndex
int $value

Returns void

Reimplemented in PreparedStatementCommon.

PreparedStatement::setNull ( $  paramIndex)

 

Parameters:
int $paramIndex

Returns void

Reimplemented in PreparedStatementCommon, and MSSQLCallableStatement.

PreparedStatement::setString ( $  paramIndex,  $  value )

 

Parameters:
int $paramIndex
string $value

Returns void

Reimplemented in PreparedStatementCommon.

PreparedStatement::setTime ( $  paramIndex,  $  value )

 

Parameters:
int $paramIndex
string $value

Returns void

Reimplemented in PreparedStatementCommon.

PreparedStatement::setTimestamp ( $  paramIndex,  $  value )

 

Parameters:
int $paramIndex
string $value

Returns void

Reimplemented in PreparedStatementCommon.


This file is part of the Creole[php4] library.


Copyright © 2004 Hans Lellelid  
Creole[php4] CVS