[ Index ]
 

Code source de SPIP Agora 1.4

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

title

Body

[fermer]

/Pear/DB/ -> oci8.php (sommaire)

(pas de description)

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

Définit 1 class

DB_oci8:: (25 méthodes):
  DB_oci8()
  connect()
  disconnect()
  simpleQuery()
  nextResult()
  fetchInto()
  freeResult()
  freePrepared()
  numRows()
  numCols()
  errorNative()
  prepare()
  execute()
  autoCommit()
  commit()
  rollback()
  affectedRows()
  modifyQuery()
  modifyLimitQuery()
  nextId()
  createSequence()
  dropSequence()
  oci8RaiseError()
  getSpecialQuery()
  tableInfo()


Classe: DB_oci8  - X-Ref

Database independent query interface definition for PHP's Oracle 8
call-interface extension.

Definitely works with versions 8 and 9 of Oracle.

DB_oci8()   X-Ref
Pas de description

connect($dsninfo, $persistent = false)   X-Ref
Connect to a database and log in as the specified user.

param: $dsn the data source name (see DB::parseDSN for syntax)
param: $persistent (optional) whether the connection should
return: int DB_OK on success, a DB error code on failure

disconnect()   X-Ref
Log out and disconnect from the database.

return: bool true on success, false if not connected.

simpleQuery($query)   X-Ref
Send a query to oracle and return the results as an oci8 resource
identifier.

param: $query the SQL query
return: int returns a valid oci8 result for successful SELECT

nextResult($result)   X-Ref
Move the internal oracle result pointer to the next available result

param: a valid oci8 result resource
return: true if a result is available otherwise return false

fetchInto($result, &$arr, $fetchmode, $rownum=null)   X-Ref
Fetch a row and insert the data into an existing array.

Formating of the array and the data therein are configurable.
See DB_result::fetchInto() for more information.

param: resource $result    query result identifier
param: array    $arr       (reference) array where data from the row
param: int      $fetchmode how the resulting array should be indexed
param: int      $rownum    the row number to fetch
return: mixed DB_OK on success, null when end of result set is

freeResult($result)   X-Ref
Free the internal resources associated with $result.

param: $result oci8 result identifier
return: bool true on success, false if $result is invalid

freePrepared($stmt)   X-Ref
Free the internal resources associated with a prepared query.

param: $stmt oci8 statement identifier
return: bool true on success, false if $result is invalid

numRows($result)   X-Ref
Pas de description

numCols($result)   X-Ref
Get the number of columns in a result set.

param: $result oci8 result identifier
return: int the number of columns per row in $result

errorNative()   X-Ref
Get the native error code of the last error (if any) that occured
on the current connection.  This does not work, as OCIError does
not work unless given a statement.  If OCIError does return
something, so will this.

return: int native oci8 error code

prepare($query)   X-Ref
Prepares a query for multiple execution with execute().

With oci8, this is emulated.

prepare() requires a generic query as string like <code>
INSERT INTO numbers VALUES (?, ?, ?)
</code>.  The <kbd>?</kbd> characters are placeholders.

Three types of placeholders can be used:
+ <kbd>?</kbd>  a quoted scalar value, i.e. strings, integers
+ <kbd>!</kbd>  value is inserted 'as is'
+ <kbd>&</kbd>  requires a file name.  The file's contents get
inserted into the query (i.e. saving binary
data in a db)

Use backslashes to escape placeholder characters if you don't want
them to be interpreted as placeholders.  Example: <code>
"UPDATE foo SET col=? WHERE col='over \& under'"
</code>

param: string $query query to be prepared
return: mixed DB statement resource on success. DB_Error on failure.

execute($stmt, $data = array()   X-Ref
Executes a DB statement prepared with prepare().

param: resource  $stmt  a DB statement resource returned from prepare()
param: mixed  $data  array, string or numeric data to be used in
return: int returns an oci8 result resource for successful

autoCommit($onoff = false)   X-Ref
Enable/disable automatic commits

param: $onoff true/false whether to autocommit

commit()   X-Ref
Commit transactions on the current connection

return: DB_ERROR or DB_OK

rollback()   X-Ref
Roll back all uncommitted transactions on the current connection.

return: DB_ERROR or DB_OK

affectedRows()   X-Ref
Gets the number of rows affected by the last query.
if the last query was a select, returns 0.

return: number of rows affected by the last query or DB_ERROR

modifyQuery($query)   X-Ref
Pas de description

modifyLimitQuery($query, $from, $count, $params = array()   X-Ref
Emulate the row limit support altering the query

author: Tomas V.V.Cox <cox@idecnet.com>
param: string $query The query to treat
param: int    $from  The row to start to fetch from
param: int    $count The offset
return: string The modified query

nextId($seq_name, $ondemand = true)   X-Ref
Returns the next free id in a sequence

param: string  $seq_name  name of the sequence
param: boolean $ondemand  when true, the seqence is automatically
return: int  the next id number in the sequence.  DB_Error if problem.

createSequence($seq_name)   X-Ref
Creates a new sequence

param: string $seq_name  name of the new sequence
return: int  DB_OK on success.  A DB_Error object is returned if

dropSequence($seq_name)   X-Ref
Deletes a sequence

param: string $seq_name  name of the sequence to be deleted
return: int  DB_OK on success.  DB_Error if problems.

oci8RaiseError($errno = null)   X-Ref
Gather information about an error, then use that info to create a
DB error object and finally return that object.

param: integer  $errno  PEAR error number (usually a DB constant) if
return: object  DB error object

getSpecialQuery($type)   X-Ref
Returns the query needed to get some backend info

param: string $type What kind of info you want to retrieve
return: string The SQL query string

tableInfo($result, $mode = null)   X-Ref
Returns information about a table or a result set.

NOTE: only supports 'table' and 'flags' if <var>$result</var>
is a table name.

NOTE: flags won't contain index information.

param: object|string  $result  DB_result object from a query or a
param: int            $mode    a valid tableInfo mode
return: array  an associative array with the information requested



Généré le : Sat Feb 24 14:40:03 2007 par Balluche grâce à PHPXref 0.7