DboOracle Class Reference

Inheritance diagram for DboOracle:

DboSource DataSource Object List of all members.

Public Member Functions

 _execute ($sql)
 _scrapeSQL ($sql)
 _setError ($source=null, $clear=false)
 alterSchema ($compare, $table=null)
 begin ()
 column ($real)
 commit ()
 connect ()
 constraint ($action, $table)
 createSequence ($sequence)
 createTrigger ($table)
 describe (&$model)
 disconnect ()
 dropSchema ($schema, $table=null)
 fetchResult ()
 fetchRow ()
 getEncoding ()
 index ($model)
 lastAffected ()
 lastError ()
 lastInsertId ($source)
 lastNumRows ()
 limit ($limit=-1, $offset=0)
 listSources ()
 name ($name)
 queryAssociation (&$model, &$linkModel, $type, $association, $assocData, &$queryData, $external=false, &$resultSet, $recursive, $stack)
 renderStatement ($type, $data)
 rollback ()
 sequenceExists ($sequence)
 setEncoding ($lang)
 truncate ($table, $reset=0)
 value ($data, $column=null, $safe=false)

Public Attributes

 $__transactionStarted = false
 $_baseConfig
 $_currentRow
 $_error
 $_limit = -1
 $_map
 $_numRows
 $_offset = 0
 $_results
 $_sequenceMap = array()
 $_sequences = array()
 $alias = ''
 $columns
 $config = array()
 $connection

Detailed Description

Definition at line 35 of file dbo_oracle.php.


Member Function Documentation

DboOracle::_execute ( sql  ) 

Executes given SQL statement. This is an overloaded method.

Parameters:
string $sql SQL statement
Returns:
resource Result resource identifier or null protected

Definition at line 322 of file dbo_oracle.php.

References _scrapeSQL(), _setError(), and limit().

DboOracle::_scrapeSQL ( sql  ) 

Scrape the incoming SQL to create the association map. This is an extremely experimental method that creates the association maps since Oracle will not tell us.

Parameters:
string $sql
Returns:
false if sql is nor a SELECT protected

Definition at line 252 of file dbo_oracle.php.

Referenced by _execute().

DboOracle::_setError ( source = null,
clear = false 
)

Keeps track of the most recent Oracle error

Definition at line 193 of file dbo_oracle.php.

Referenced by _execute(), and connect().

DboOracle::alterSchema ( compare,
table = null 
)

Generate a Oracle Alter Table syntax for the given Schema comparison

Parameters:
unknown_type $schema
Returns:
unknown

Reimplemented from DboSource.

Definition at line 670 of file dbo_oracle.php.

References $out, DboSource::buildColumn(), DboSource::fullTableName(), and name().

DboOracle::begin (  ) 

Begin a transaction

Parameters:
unknown_type $model
Returns:
boolean True on success, false on fail (i.e. if the database/model does not support transactions).

Definition at line 740 of file dbo_oracle.php.

DboOracle::column ( real  ) 

Converts database-layer column types to basic types

Parameters:
string $real Real database-layer column type (i.e. "varchar(255)")
Returns:
string Abstract column type (i.e. "string") public

Reimplemented from DataSource.

Definition at line 774 of file dbo_oracle.php.

References limit(), and name().

Referenced by describe(), and index().

DboOracle::commit (  ) 

Commit a transaction

Parameters:
unknown_type $model
Returns:
boolean True on success, false on fail (i.e. if the database/model does not support transactions, or a transaction has not started).

Definition at line 763 of file dbo_oracle.php.

DboOracle::connect (  ) 

Connects to the database using options in the given configuration array.

Returns:
boolean True if the database could be connected, else false public

Definition at line 160 of file dbo_oracle.php.

References $config, _setError(), config(), and DboSource::execute().

DboOracle::constraint ( action,
table 
)

Enables, disables, and lists table constraints

Note: This method could have been written using a subselect for each table, however the effort Oracle expends to run the constraint introspection is very high. Therefore, this method caches the result once and loops through the arrays to find what it needs. It reduced my query time by 50%. YMMV.

Parameters:
string $action
string $table
Returns:
mixed boolean true or array of constraints

Definition at line 558 of file dbo_oracle.php.

References __(), DboSource::execute(), and fetchRow().

DboOracle::createSequence ( sequence  ) 

Creates a database sequence

Parameters:
string $sequence
Returns:
bool public

Definition at line 420 of file dbo_oracle.php.

References DboSource::execute().

DboOracle::createTrigger ( table  ) 

Enter description here...

Parameters:
unknown_type $table
Returns:
unknown public

Definition at line 431 of file dbo_oracle.php.

References DboSource::execute().

DboOracle::describe ( &$  model  ) 

Returns an array of the fields in given table name.

Parameters:
object instance of a model to inspect
Returns:
array Fields in table. Keys are name and type public

Definition at line 467 of file dbo_oracle.php.

References DataSource::__cacheDescription(), column(), DboSource::execute(), fetchRow(), DboSource::fullTableName(), and DboSource::length().

DboOracle::disconnect (  ) 

Disconnects from database.

Returns:
boolean True if the database could be disconnected, else false public

Definition at line 238 of file dbo_oracle.php.

DboOracle::dropSchema ( schema,
table = null 
)

Generate a "drop table" statement for the given Schema object

Parameters:
object $schema An instance of a subclass of CakeSchema
string $table Optional. If specified only the table name given will be generated. Otherwise, all tables defined in the schema are generated.
Returns:
string

Reimplemented from DboSource.

Definition at line 1106 of file dbo_oracle.php.

References $columns, $out, __(), and DboSource::fullTableName().

DboOracle::fetchResult (  ) 

Fetches the next row from the current result set

Returns:
unknown

Definition at line 396 of file dbo_oracle.php.

References fetchRow().

DboOracle::fetchRow (  ) 

Enter description here...

Returns:
unknown public

Definition at line 368 of file dbo_oracle.php.

References DboSource::$index.

Referenced by constraint(), describe(), fetchResult(), getEncoding(), lastInsertId(), listSources(), sequenceExists(), and truncate().

DboOracle::getEncoding (  ) 

Gets the current encoding language

Returns:
string language constant

Definition at line 221 of file dbo_oracle.php.

References DboSource::execute(), and fetchRow().

DboOracle::index ( model  ) 

Returns an array of the indexes in given table name.

Parameters:
string $model Name of model to inspect
Returns:
array Fields in table. Keys are column and unique

Reimplemented from DboSource.

Definition at line 629 of file dbo_oracle.php.

References DboSource::$index, column(), DboSource::fullTableName(), and DboSource::query().

DboOracle::lastAffected (  ) 

Returns number of affected rows in previous database operation. If no previous operation exists, this returns false.

Returns:
int Number of affected rows public

Definition at line 892 of file dbo_oracle.php.

DboOracle::lastError (  ) 

Returns a formatted error message from previous database operation.

Returns:
string Error message with error number public

Definition at line 883 of file dbo_oracle.php.

DboOracle::lastInsertId ( source  ) 

Returns the ID generated from the previous INSERT operation.

Parameters:
string 
Returns:
integer public

Reimplemented from DataSource.

Definition at line 864 of file dbo_oracle.php.

References DboSource::execute(), and fetchRow().

DboOracle::lastNumRows (  ) 

Returns number of rows in previous resultset. If no previous resultset exists, this returns false.

Returns:
integer Number of rows in resultset public

Definition at line 312 of file dbo_oracle.php.

DboOracle::limit ( limit = -1,
offset = 0 
)

Modify a SQL query to limit (and offset) the result set

Parameters:
integer $limit Maximum number of rows to return
integer $offset Row to begin returning
Returns:
modified SQL Query public

Reimplemented from DboSource.

Definition at line 301 of file dbo_oracle.php.

Referenced by _execute(), column(), and queryAssociation().

DboOracle::listSources (  ) 

Returns an array of tables in the database. If there are no tables, an error is raised and the application exits.

Returns:
array tablenames in the database public

Definition at line 442 of file dbo_oracle.php.

References DboSource::execute(), fetchRow(), and name().

DboOracle::name ( name  ) 

This method should quote Oracle identifiers. Well it doesn't. It would break all scaffolding and all of Cake's default assumptions.

Parameters:
unknown_type $var
Returns:
unknown public

Reimplemented from DboSource.

Definition at line 720 of file dbo_oracle.php.

Referenced by alterSchema(), column(), and listSources().

DboOracle::queryAssociation ( &$  model,
&$  linkModel,
type,
association,
assocData,
&$  queryData,
external = false,
&$  resultSet,
recursive,
stack 
)

Enter description here...

Parameters:
Model $model
unknown_type $linkModel
string $type Association type
unknown_type $association
unknown_type $assocData
unknown_type $queryData
unknown_type $external
unknown_type $resultSet
integer $recursive Number of levels of association
array $stack

Reimplemented from DboSource.

Definition at line 954 of file dbo_oracle.php.

References $res, __(), DboSource::__mergeAssociation(), DboSource::__mergeHasMany(), Set::diff(), error(), DboSource::fetchAll(), DboSource::generateAssociationQuery(), ConnectionManager::getDataSource(), DataSource::insertQueryData(), limit(), and Configure::read().

DboOracle::renderStatement ( type,
data 
)

Renders a final SQL statement by putting together the component parts in the correct order

Parameters:
string $type
array $data
Returns:
string

Reimplemented from DboSource.

Definition at line 902 of file dbo_oracle.php.

References $alias, $columns, DboSource::create(), and DboSource::update().

DboOracle::rollback (  ) 

Rollback a transaction

Parameters:
unknown_type $model
Returns:
boolean True on success, false on fail (i.e. if the database/model does not support transactions, or a transaction has not started).

Definition at line 752 of file dbo_oracle.php.

DboOracle::sequenceExists ( sequence  ) 

Checks to see if a named sequence exists

Parameters:
string $sequence
Returns:
bool public

Definition at line 406 of file dbo_oracle.php.

References DboSource::execute(), and fetchRow().

DboOracle::setEncoding ( lang  ) 

Sets the encoding language of the session

Parameters:
string $lang language constant
Returns:
bool

Definition at line 210 of file dbo_oracle.php.

References DboSource::execute().

DboOracle::truncate ( table,
reset = 0 
)

Deletes all the records in a table and drops all associated auto-increment sequences. Using DELETE instead of TRUNCATE because it causes locking problems.

Parameters:
mixed $table A string or model class representing the table to be truncated
integer $reset If -1, sequences are dropped, if 0 (default), sequences are reset, and if 1, sequences are not modified
Returns:
boolean SQL TRUNCATE TABLE statement, false if not applicable. public

Definition at line 512 of file dbo_oracle.php.

References DboSource::execute(), fetchRow(), and DboSource::fullTableName().

DboOracle::value ( data,
column = null,
safe = false 
)

Returns a quoted and escaped string of $data for use in an SQL statement.

Parameters:
string $data String to be prepared for use in an SQL statement
Returns:
string Quoted and escaped public

Reimplemented from DboSource.

Definition at line 824 of file dbo_oracle.php.


Member Data Documentation

DboOracle::$__transactionStarted = false

Definition at line 58 of file dbo_oracle.php.

DboOracle::$_baseConfig

Initial value:

 array(
        'persistent' => true,
        'host' => 'localhost',
        'login' => 'system',
        'password' => '',
        'database' => 'cake',
        'nls_sort' => '',
        'nls_sort' => ''
    )

Reimplemented from DataSource.

Definition at line 139 of file dbo_oracle.php.

DboOracle::$_currentRow

Definition at line 113 of file dbo_oracle.php.

DboOracle::$_error

Definition at line 133 of file dbo_oracle.php.

DboOracle::$_limit = -1

Definition at line 92 of file dbo_oracle.php.

DboOracle::$_map

Definition at line 106 of file dbo_oracle.php.

DboOracle::$_numRows

Definition at line 120 of file dbo_oracle.php.

DboOracle::$_offset = 0

Definition at line 99 of file dbo_oracle.php.

DboOracle::$_results

Definition at line 127 of file dbo_oracle.php.

DboOracle::$_sequenceMap = array()

Definition at line 153 of file dbo_oracle.php.

DboOracle::$_sequences = array()

Sequence names as introspected from the database

Definition at line 52 of file dbo_oracle.php.

DboOracle::$alias = ''

Reimplemented from DboSource.

Definition at line 48 of file dbo_oracle.php.

Referenced by renderStatement().

DboOracle::$columns

Initial value:

 array(
        'primary_key' => array('name' => ''),
        'string' => array('name' => 'varchar2', 'limit' => '255'),
        'text' => array('name' => 'varchar2'),
        'integer' => array('name' => 'number'),
        'float' => array('name' => 'float'),
        'datetime' => array('name' => 'date', 'format' => 'Y-m-d H:i:s'),
        'timestamp' => array('name' => 'date', 'format' => 'Y-m-d H:i:s'),
        'time' => array('name' => 'date', 'format' => 'Y-m-d H:i:s'),
        'date' => array('name' => 'date', 'format' => 'Y-m-d H:i:s'),
        'binary' => array('name' => 'bytea'),
        'boolean' => array('name' => 'boolean'),
        'number' => array('name' => 'number'),
        'inet' => array('name' => 'inet'))

Definition at line 65 of file dbo_oracle.php.

Referenced by dropSchema(), and renderStatement().

DboOracle::$config = array()

Reimplemented from DataSource.

Definition at line 42 of file dbo_oracle.php.

Referenced by connect().

DboOracle::$connection

Reimplemented from DataSource.

Definition at line 85 of file dbo_oracle.php.


The documentation for this class was generated from the following file:
Generated on Sun Nov 22 00:30:55 2009 for CakePHP 1.2.x.x (v1.2.4.8284) by doxygen 1.4.7