[ Index ]
 

Code source de Symfony 1.0.0

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/vendor/creole/drivers/oracle/ -> OCI8PreparedStatement.php (sommaire)

(pas de description)

Poids: 424 lignes (16 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

OCI8PreparedStatement:: (13 méthodes):
  close()
  escape()
  executeQuery()
  executeUpdate()
  bindVars()
  sqlToOracleBindVars()
  setBlob()
  setClob()
  setString()
  setTimestamp()
  setDate()
  setColumnArray()
  setNull()


Classe: OCI8PreparedStatement  - X-Ref

Oracle (OCI8) implementation of PreparedStatement.

close()   X-Ref
If the statement is set, free it.


escape($str)   X-Ref
Nothing to do - since oci_bind is used to insert data, no escaping is needed

param: string $str
return: string

executeQuery($p1 = null, $fetchmode = null)   X-Ref
Executes the SQL query in this PreparedStatement object and returns the resultset generated by the query.

param: mixed $p1 Either (array) Parameters that will be set using PreparedStatement::set() before query is executed or (int) fetchmode.
param: int $fetchmode The mode to use when fetching the results (e.g. ResultSet::FETCHMODE_NUM, ResultSet::FETCHMODE_ASSOC).
return: ResultSet

executeUpdate($params = null)   X-Ref
Executes the SQL INSERT, UPDATE, or DELETE statement in this PreparedStatement object.

param: array $params Parameters that will be set using PreparedStatement::set() before query is executed.
return: int Number of affected rows (or 0 for drivers that return nothing).

bindVars($stmt)   X-Ref
Performs the actual binding of variables using oci_bind_by_name().

This may seem like useless overhead, but the reason why calls to oci_bind_by_name()
are not performed in the set*() methods is that it is possible that the SQL will
need to be modified -- e.g. by a setLimit() call -- and re-prepared.  We cannot assume
that the statement has been prepared when the set*() calls are invoked.  This also means,
therefore, that the set*() calls will not throw exceptions; all exceptions will be thrown
when the statement is prepared.

param: resource $stmt The statement result of oci_parse to use for binding.
return: void

sqlToOracleBindVars($sql)   X-Ref
Convert a Propel SQL into Oracle SQL

Look for all of the '?' and replace with ":varX"

param: string $sql SQL in Propel native format
return: string SQL in Oracle Bind Var format

setBlob($paramIndex, $blob)   X-Ref

param: string $paramIndex
param: mixed $blob Blob object or string containing data.
return: void

setClob($paramIndex, $clob)   X-Ref

param: string $paramIndex
param: mixed $clob Clob object or string containing data.
return: void

setString($paramIndex, $value)   X-Ref
Since bind variables in oracle have no special characters, this setString method differs from the
common one in that it does not single quote strings.

param: int $paramIndex
param: string $value
return: void

setTimestamp($paramIndex, $value)   X-Ref
Copied this function from common/PreparedStatement.php and modified to work with Oracle
Please note the format used with date() matches that of NLS_DATE_FORMAT set in
OCI8Connection.php

param: int $paramIndex
param: string $value
return: void

setDate($paramIndex, $value)   X-Ref
Please note the format used with date() matches that of NLS_DATE_FORMAT set in
OCI8Connection.php

param: int $paramIndex
param: string $value
return: void

setColumnArray()   X-Ref
In order to send lob data (clob/blob) to the Oracle data base, the
sqlToOracleBindVars function needs to have an ordered list of the
columns being addressed in the sql statement.
Since only insert and update statements require special handling,
there are two ways to find the columns:
1) find the first set of () and parse out the columns names based on
the token ','
2) find all the text strings to the left of the equal signs.

param: void
return: void

setNull($paramIndex)   X-Ref

param: int $paramIndex
return: void



Généré le : Fri Mar 16 22:42:14 2007 par Balluche grâce à PHPXref 0.7