Class CI_DB_oci8_driver - echiong/testRepo GitHub Wiki
##Class CI_DB_oci8_driver
oci8 Database Adapter Class
This is a modification of the DB_driver class to permit access to oracle databases
Author:
Kelly McArdle
Located at system/database/drivers/oci8/oci8_driver.php
##Methods summary
public resource db_connect ( )
Non-persistent database connection
Returns
resource
public resource db_pconnect ( )
Persistent database connection
Returns
resource
public reconnect ( )
Reconnect
Keep / reestablish the db connection if no queries have been sent for a length of time exceeding the server's idle timeout
public resource db_select ( )
Select the database
Returns
resource
public resource db_set_charset ( string $charset, string $collation )
Set client character set
Parameters
$charset
string
$collation
string
Returns
resource
protected string _version ( )
Version number query string
Returns
string
protected resource _execute ( string $sql )
Execute the query
Parameters
$sql
string
an SQL query
Returns
resource
public cursor get_cursor ( )
getCursor. Returns a cursor from the datbase
Returns
cursor
id
public array stored_procedure ( package $package, procedure $procedure, params $params )
Stored Procedure. Executes a stored procedure
Parameters
$package
package
package stored procedure is in
$procedure
procedure
stored procedure to execute
$params
params
array of parameters
Returns
array
params array keys KEY OPTIONAL NOTES name no the name of the parameter should be
in :<param_name> format value no the value of the parameter. If this is an
OUT or IN OUT parameter, this should be a reference to a variable type yes the
type of the parameter length yes the max size of the parameter
public boolean trans_begin ( mixed $test_mode = FALSE )
Begin Transaction
Returns
boolean
public boolean trans_commit ( )
Commit Transaction
Returns
boolean
public boolean trans_rollback ( )
Rollback Transaction
Returns
boolean
public string escape_str ( string $str, boolean $like = FALSE )
Escape String
Parameters
$str
string
$like
boolean
whether or not the string will be used in a LIKE condition
Returns
string
public integer affected_rows ( )
Affected Rows
Returns
integer
public integer insert_id ( )
Insert ID
Returns
integer
public string count_all ( string $table = '' )
"Count All" query
Generates a platform-specific query string that counts all records in the specified database
Parameters
$table
string
Returns
string
protected string _list_tables ( boolean $prefix_limit = FALSE )
Show table query
Generates a platform-specific query string so that the table names can be fetched
Parameters
$prefix_limit
boolean
Returns
string
protected string _list_columns ( string $table = '' )
Show column query
Generates a platform-specific query string so that the column names can be fetched
Parameters
$table
string
the table name
Returns
string
protected object _field_data ( string $table )
Field data query
Generates a platform-specific query so that the column data can be retrieved
Parameters
$table
string
the table name
Returns
object
protected string _error_message ( )
The error message string
Returns
string
protected integer _error_number ( )
The error message number
Returns
integer
protected string _escape_identifiers ( string $item )
Escape the SQL Identifiers
This function escapes column and table names
Parameters
$item
string
Returns
string
protected type _from_tables ( type $tables )
From Tables
This function implicitly groups FROM tables so there is no confusion about operator precedence in harmony with SQL standards
Parameters
$tables
type
Returns
type
protected string _insert ( string $table, array $keys, array $values )
Insert statement
Generates a platform-specific insert string from the supplied data
Parameters
$table
string
the table name
$keys
array
the insert keys
$values
array
the insert values
Returns
string
protected string _insert_batch ( string $table, array $keys, array $values )
Insert_batch statement
Generates a platform-specific insert string from the supplied data
Parameters
$table
string
the table name
$keys
array
the insert keys
$values
array
the insert values
Returns
string
protected string _update ( string $table, array $values, array $where, array $orderby = array(), array $limit = FALSE )
Update statement
Generates a platform-specific update string from the supplied data
Parameters
$table
string
the table name
$values
array
the update data
$where
array
the where clause
$orderby
array
the orderby clause
$limit
array
the limit clause
Returns
string
protected string _truncate ( string $table )
Truncate statement
Generates a platform-specific truncate string from the supplied data If the database does not support the truncate() command This function maps to "DELETE FROM table"
Parameters
$table
string
the table name
Returns
string
protected string _delete ( string $table, array $where = array(), string $like = array(), mixed $limit = FALSE )
Delete statement
Generates a platform-specific delete string from the supplied data
Parameters
$table
string
the table name
$where
array
the where clause
$like
string
the limit clause
$limit
Returns
string
protected string _limit ( string $sql, integer $limit, integer $offset )
Limit string
Generates a platform-specific LIMIT clause
Parameters
$sql
string
the sql query string
$limit
integer
the number of rows to limit the query to
$offset
integer
the offset value
Returns
string
protected _close ( resource $conn_id )
Close DB Connection
Parameters
$conn_id
resource
<table class="summary" id="properties">
<caption>Properties summary</caption>
<tr data-order="dbdriver" id="$dbdriver">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$dbdriver
'oci8'
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="_escape_char" id="$_escape_char">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$_escape_char
'"'
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="_like_escape_str" id="$_like_escape_str">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$_like_escape_str
" escape '%s' "
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="_like_escape_chr" id="$_like_escape_chr">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$_like_escape_chr
'!'
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="_count_string" id="$_count_string">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$_count_string
"SELECT COUNT(1) AS "
<div class="description detailed">
The syntax to count rows is slightly different across different database engines, so this string appears in each driver and is used for the count_all() and count_all_results() functions.
</div>
</div></td>
</tr>
<tr data-order="_random_keyword" id="$_random_keyword">
<td class="attributes"><code>
public
string
</code></td>
<td class="name">
$_random_keyword
' ASC'
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="_commit" id="$_commit">
<td class="attributes"><code>
public
mixed
</code></td>
<td class="name">
$_commit
OCI_COMMIT_ON_SUCCESS
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="stmt_id" id="$stmt_id">
<td class="attributes"><code>
public
mixed
</code></td>
<td class="name">
$stmt_id
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="curs_id" id="$curs_id">
<td class="attributes"><code>
public
mixed
</code></td>
<td class="name">
$curs_id
<div class="description detailed">
</div>
</div></td>
</tr>
<tr data-order="limit_used" id="$limit_used">
<td class="attributes"><code>
public
mixed
</code></td>
<td class="name">
$limit_used
<div class="description detailed">
</div>
</div></td>
</tr>
</table>