Class ADODB_oci8

Description

Connection object. For connecting to databases, and executing queries.

Located in /3rd/adodb/drivers/adodb-oci8.inc.php (line 55)

ADOConnection
   |
   --ADODB_oci8
Direct descendents
Class Description
 class ADODB_oci8po Connection object. For connecting to databases, and executing queries.
 class ADODB_oci805 Connection object. For connecting to databases, and executing queries.
Variable Summary
Method Summary
 ADODB_oci8 ADODB_oci8 ()
 void BeginTrans ()
 void Bind ( &$stmt,  &$var, [ $size = 4000], [ $type = false], [ $name = false], [ $isOutput = false])
 void CharMax ()
 void CommitTrans ([ $ok = true])
 void DBDate ( $d)
 void DBTimeStamp ( $ts)
 void ErrorMsg ()
 void ErrorNo ()
 RecordSet &Execute (sql $sql, [[inputarr] $inputarr = false])
 void &ExecuteCursor ( $sql, [ $cursorName = 'rs'], [ $params = false])
 void IfNull ( $field,  $ifNull)
 void &MetaColumns ( $table)
 void MetaForeignKeys ( $table, [ $owner = false])
 void &MetaIndexes ( $table, [ $primary = FALSE], [ $owner = false])
 void MetaPrimaryKeys ( $table, [ $owner = false], [ $internalKey = false])
 void &MetaTables ([ $ttype = false], [ $showSchema = false], [ $mask = false])
 void Param ( $name, [ $type = false])
 void Parameter ( &$stmt,  &$var,  $name, [ $isOutput = false], [ $maxLen = 4000], [ $type = false])
 void Prepare ( $sql, [ $cursor = false])
 quoted qstr (s $s, [[magic_quotes] $magic_quotes = false])
 void RollbackTrans ()
 void RowLock ( $tables,  $where, [ $flds = '1 as ignore'])
 void SelectDB ( $dbName)
 void &SelectLimit ( $sql, [ $nrows = -1], [ $offset = -1], [ $inputarr = false], [ $secs2cache = 0])
 void ServerInfo ()
 void SQLDate ( $fmt, [ $col = false])
 void TextMax ()
 void Time ()
 void UpdateBlob ( $table,  $column,  $val,  $where, [ $blobtype = 'BLOB'])
 void UpdateBlobFile ( $table,  $column,  $val,  $where, [ $blobtype = 'BLOB'])
 void _affectedrows ()
 void _close ()
 void _connect ( $argHostname,  $argUsername,  $argPassword,  $argDatabasename, [ $mode = 0])
 void _nconnect ( $argHostname,  $argUsername,  $argPassword,  $argDatabasename)
 void _pconnect ( $argHostname,  $argUsername,  $argPassword,  $argDatabasename)
 void _query ( $sql,  $inputarr)
Variables
mixed $concat_operator = '||' (line 59)

Redefinition of:
ADOConnection::$concat_operator
mixed $connectSID = false (line 76)

Redefined in descendants as:
mixed $databaseType = 'oci8' (line 56)

Redefinition of:
ADOConnection::$databaseType

Redefined in descendants as:
mixed $dataProvider = 'oci8' (line 57)

Redefinition of:
ADOConnection::$dataProvider

Redefined in descendants as:
mixed $datetime = false (line 86)
mixed $firstrows = true (line 82)
mixed $hasAffectedRows = true (line 73)

Redefinition of:
ADOConnection::$hasAffectedRows
mixed $hasGenID = true (line 69)

Redefinition of:
ADOConnection::$hasGenID
mixed $leftOuter = '' (line 80)

Redefinition of:
ADOConnection::$leftOuter
mixed $metaColumnsSQL = "select cname,coltype,width, SCALE, PRECISION, NULLS, DEFAULTVAL from col where tname='%s' order by colno" (line 67)

Redefined in descendants as:
mixed $metaDatabasesSQL = "SELECT USERNAME FROM ALL_USERS WHERE USERNAME NOT IN ('SYS','SYSTEM','DBSNMP','OUTLN') ORDER BY 1" (line 62)

Redefinition of:
ADOConnection::$metaDatabasesSQL
mixed $metaTablesSQL = "select table_name,table_type from cat where table_type in ('TABLE','VIEW')" (line 66)

Redefinition of:
ADOConnection::$metaTablesSQL

Redefined in descendants as:
mixed $NLS_DATE_FORMAT = 'YYYY-MM-DD' (line 84)
mixed $noNullStrings = false (line 75)

Redefinition of:
ADOConnection::$noNullStrings
mixed $random = "abs(mod(DBMS_RANDOM.RANDOM,10000001)/10000000)" (line 74)

Redefinition of:
ADOConnection::$random
mixed $replaceQuote = "''" (line 58)

Redefinition of:
ADOConnection::$replaceQuote
mixed $selectOffsetAlg1 = 100 (line 83)
mixed $session_sharing_force_blob = false (line 81)
mixed $sysDate = "TRUNC(SYSDATE)" (line 60)

Redefinition of:
ADOConnection::$sysDate
mixed $sysTimeStamp = 'SYSDATE' (line 61)

Redefinition of:
ADOConnection::$sysTimeStamp
mixed $useDBDateFormatForTextInput = false (line 85)
mixed $_bind = false (line 77)
mixed $_bindInputArray = true (line 68)

Redefinition of:
ADOConnection::$_bindInputArray
mixed $_commit = OCI_COMMIT_ON_SUCCESS (line 64)
mixed $_dropSeqSQL = "DROP SEQUENCE %s" (line 72)
mixed $_genIDSQL = "SELECT (%s.nextval) FROM DUAL" (line 70)
mixed $_genSeqSQL = "CREATE SEQUENCE %s START WITH %s" (line 71)
mixed $_getarray = false (line 79)
mixed $_hasOCIFetchStatement = false (line 78)
mixed $_initdate = true (line 65)
mixed $_refLOBs = array() (line 87)
mixed $_stmt (line 63)

Inherited Variables

Inherited from ADOConnection

ADOConnection::$ansiOuter
ADOConnection::$arrayClass
ADOConnection::$autoCommit
ADOConnection::$autoRollback
ADOConnection::$blobEncodeType
ADOConnection::$cacheSecs
ADOConnection::$charSet
ADOConnection::$database
ADOConnection::$debug
ADOConnection::$emptyDate
ADOConnection::$emptyTimeStamp
ADOConnection::$false
ADOConnection::$fetchMode
ADOConnection::$fmtDate
ADOConnection::$fmtTimeStamp
ADOConnection::$fnCacheExecute
ADOConnection::$fnExecute
ADOConnection::$genID
ADOConnection::$hasInsertID
ADOConnection::$hasLimit
ADOConnection::$hasMoveFirst
ADOConnection::$hasTop
ADOConnection::$hasTransactions
ADOConnection::$host
ADOConnection::$isoDates
ADOConnection::$lastInsID
ADOConnection::$length
ADOConnection::$maxblobsize
ADOConnection::$nameQuote
ADOConnection::$numCacheHits
ADOConnection::$numCacheMisses
ADOConnection::$pageExecuteCountRows
ADOConnection::$password
ADOConnection::$poorAffectedRows
ADOConnection::$raiseErrorFn
ADOConnection::$readOnly
ADOConnection::$rightOuter
ADOConnection::$rsPrefix
ADOConnection::$substr
ADOConnection::$transCnt
ADOConnection::$transOff
ADOConnection::$true
ADOConnection::$uniqueOrderBy
ADOConnection::$uniqueSort
ADOConnection::$upperCase
ADOConnection::$user
ADOConnection::$_affected
ADOConnection::$_connectionID
ADOConnection::$_errorCode
ADOConnection::$_errorMsg
ADOConnection::$_evalAll
ADOConnection::$_isPersistentConnection
ADOConnection::$_logsql
ADOConnection::$_oldRaiseFn
ADOConnection::$_queryID
ADOConnection::$_transOK
Methods
Constructor ADODB_oci8 (line 91)
ADODB_oci8 ADODB_oci8 ()
BeginTrans (line 378)
void BeginTrans ()

Redefinition of:
ADOConnection::BeginTrans()
Begin a Transaction. Must be followed by CommitTrans() or RollbackTrans().
Bind (line 841)
void Bind ( &$stmt,  &$var, [ $size = 4000], [ $type = false], [ $name = false], [ $isOutput = false])
  • &$stmt
  • &$var
  • $size
  • $type
  • $name
  • $isOutput
CharMax (line 1137)
void CharMax ()
CommitTrans (line 387)
void CommitTrans ([ $ok = true])
  • $ok

Redefinition of:
ADOConnection::CommitTrans()
If database does not support transactions, always return true as data always commited
DBDate (line 273)
void DBDate ( $d)
  • $d

Redefinition of:
ADOConnection::DBDate()
Converts a date "d" to a string that the database can understand.
DBTimeStamp (line 283)
void DBTimeStamp ( $ts)
  • $ts

Redefinition of:
ADOConnection::DBTimeStamp()
Converts a timestamp "ts" to a string that the database can understand.
ErrorMsg (line 415)
void ErrorMsg ()

Redefinition of:
ADOConnection::ErrorMsg()
ErrorNo (line 430)
void ErrorNo ()

Redefinition of:
ADOConnection::ErrorNo()
Execute (line 719)

Execute SQL

  • return: or false
RecordSet &Execute (sql $sql, [[inputarr] $inputarr = false])
  • sql $sql: SQL statement to execute, or possibly an array holding prepared statement ($sql[0] will hold sql text)
  • [inputarr] $inputarr: holds the input data to bind to. Null elements will be set to null.

Redefinition of:
ADOConnection::Execute()
Execute SQL
ExecuteCursor (line 789)
void &ExecuteCursor ( $sql, [ $cursorName = 'rs'], [ $params = false])
  • $sql
  • $cursorName
  • $params
IfNull (line 267)
void IfNull ( $field,  $ifNull)
  • $field
  • $ifNull

Redefinition of:
ADOConnection::IfNull()
MetaColumns (line 98)
void &MetaColumns ( $table)
  • $table

Redefinition of:
ADOConnection::MetaColumns()
List columns in a database as an array of ADOFieldObjects.
MetaForeignKeys (line 1097)
void MetaForeignKeys ( $table, [ $owner = false])
  • $table
  • $owner

Redefinition of:
ADOConnection::MetaForeignKeys()
MetaIndexes (line 312)
void &MetaIndexes ( $table, [ $primary = FALSE], [ $owner = false])
  • $table
  • $primary
  • $owner

Redefinition of:
ADOConnection::MetaIndexes()
List indexes on a table as an array.
MetaPrimaryKeys (line 1062)
void MetaPrimaryKeys ( $table, [ $owner = false], [ $internalKey = false])
  • $table
  • $owner
  • $internalKey

Redefinition of:
ADOConnection::MetaPrimaryKeys()
MetaTables (line 296)
void &MetaTables ([ $ttype = false], [ $showSchema = false], [ $mask = false])
  • $ttype
  • $showSchema
  • $mask

Redefinition of:
ADOConnection::MetaTables()
Param (line 892)
void Param ( $name, [ $type = false])
  • $name
  • $type

Redefinition of:
ADOConnection::Param()

Redefined in descendants as:
Parameter (line 913)
void Parameter ( &$stmt,  &$var,  $name, [ $isOutput = false], [ $maxLen = 4000], [ $type = false])
  • &$stmt
  • &$var
  • $name
  • $isOutput
  • $maxLen
  • $type

Redefinition of:
ADOConnection::Parameter()
Prepare (line 758)
void Prepare ( $sql, [ $cursor = false])
  • $sql
  • $cursor

Redefinition of:
ADOConnection::Prepare()
Should prepare the sql statement and return the stmt resource.

Redefined in descendants as:
qstr (line 1157)

Quotes a string.

An example is $db->qstr("Don't bother",magic_quotes_runtime());

  • return: string to be sent back to database
quoted qstr (s $s, [[magic_quotes] $magic_quotes = false])
  • s $s: the string to quote
  • [magic_quotes] $magic_quotes: if $s is GET/POST var, set to get_magic_quotes_gpc(). This undoes the stupidity of magic quotes for GPC.

Redefinition of:
ADOConnection::qstr()
Correctly quotes a string so that all strings are escaped. We prefix and append to the string single-quotes.
RollbackTrans (line 399)
void RollbackTrans ()

Redefinition of:
ADOConnection::RollbackTrans()
If database does not support transactions, rollbacks always fail, so return false
RowLock (line 290)
void RowLock ( $tables,  $where, [ $flds = '1 as ignore'])
  • $tables
  • $where
  • $flds

Redefinition of:
ADOConnection::RowLock()
Lock a row, will escalate and lock the table if row locking not supported will normally free the lock at the end of the transaction
SelectDB (line 410)
void SelectDB ( $dbName)
  • $dbName

Redefinition of:
ADOConnection::SelectDB()
Choose a database to connect to. Many databases do not support this.
SelectLimit (line 537)
void &SelectLimit ( $sql, [ $nrows = -1], [ $offset = -1], [ $inputarr = false], [ $secs2cache = 0])
  • $sql
  • $nrows
  • $offset
  • $inputarr
  • $secs2cache

Redefinition of:
ADOConnection::SelectLimit()
Will select, getting rows from $offset (1-based), for $nrows.

Redefined in descendants as:
ServerInfo (line 242)
void ServerInfo ()

Redefinition of:
ADOConnection::ServerInfo()
SQLDate (line 448)
void SQLDate ( $fmt, [ $col = false])
  • $fmt
  • $col

Redefinition of:
ADOConnection::SQLDate()
TextMax (line 1142)
void TextMax ()
Time (line 140)
void Time ()

Redefinition of:
ADOConnection::Time()
UpdateBlob (line 652)

Usage: Store BLOBs and CLOBs

Example: to store $var in a blob

$conn->Execute('insert into TABLE (id,ablob) values(12,empty_blob())'); $conn->UpdateBlob('TABLE', 'ablob', $varHoldingBlob, 'ID=12', 'BLOB');

$blobtype supports 'BLOB' and 'CLOB', but you need to change to 'empty_clob()'.

to get length of LOB: select DBMS_LOB.GETLENGTH(ablob) from TABLE

If you are using CURSOR_SHARING = force, it appears this will case a segfault under oracle 8.1.7.0. Run: $db->Execute('ALTER SESSION SET CURSOR_SHARING=EXACT'); before UpdateBlob() then...

void UpdateBlob ( $table,  $column,  $val,  $where, [ $blobtype = 'BLOB'])
  • $table
  • $column
  • $val
  • $where
  • $blobtype

Redefinition of:
ADOConnection::UpdateBlob()
Update a blob column, given a where clause. There are more sophisticated blob handling functions that we could have implemented, but all require a very complex API. Instead we have chosen something that is extremely simple to understand and use.
UpdateBlobFile (line 686)

Usage: store file pointed to by $var in a blob

void UpdateBlobFile ( $table,  $column,  $val,  $where, [ $blobtype = 'BLOB'])
  • $table
  • $column
  • $val
  • $where
  • $blobtype

Redefinition of:
ADOConnection::UpdateBlobFile()
Usage: UpdateBlob('TABLE', 'COLUMN', '/path/to/file', 'ID=1');
_affectedrows (line 261)
void _affectedrows ()
_close (line 1045)
void _close ()
_connect (line 182)
void _connect ( $argHostname,  $argUsername,  $argPassword,  $argDatabasename, [ $mode = 0])
  • $argHostname
  • $argUsername
  • $argPassword
  • $argDatabasename
  • $mode
_nconnect (line 256)
void _nconnect ( $argHostname,  $argUsername,  $argPassword,  $argDatabasename)
  • $argHostname
  • $argUsername
  • $argPassword
  • $argDatabasename

Redefinition of:
ADOConnection::_nconnect()
_pconnect (line 250)
void _pconnect ( $argHostname,  $argUsername,  $argPassword,  $argDatabasename)
  • $argHostname
  • $argUsername
  • $argPassword
  • $argDatabasename
_query (line 938)
void _query ( $sql,  $inputarr)
  • $sql
  • $inputarr

Redefined in descendants as:

Inherited Methods

Inherited From ADOConnection

 ADOConnection::ADOConnection()
 ADOConnection::addq()
 ADOConnection::Affected_Rows()
 ADOConnection::AutoExecute()
 ADOConnection::BeginTrans()
 ADOConnection::BlobDecode()
 ADOConnection::BlobEncode()
 ADOConnection::CacheExecute()
 ADOConnection::CacheFlush()
 ADOConnection::CacheGetAll()
 ADOConnection::CacheGetArray()
 ADOConnection::CacheGetAssoc()
 ADOConnection::CacheGetCol()
 ADOConnection::CacheGetOne()
 ADOConnection::CacheGetRow()
 ADOConnection::CachePageExecute()
 ADOConnection::CacheSelectLimit()
 ADOConnection::Close()
 ADOConnection::CommitLock()
 ADOConnection::CommitTrans()
 ADOConnection::CompleteTrans()
 ADOConnection::Concat()
 ADOConnection::Connect()
 ADOConnection::CreateSequence()
 ADOConnection::DBDate()
 ADOConnection::DBTimeStamp()
 ADOConnection::Disconnect()
 ADOConnection::DropSequence()
 ADOConnection::ErrorMsg()
 ADOConnection::ErrorNative()
 ADOConnection::ErrorNo()
 ADOConnection::escape()
 ADOConnection::Execute()
 ADOConnection::FailTrans()
 ADOConnection::GenID()
 ADOConnection::GetAll()
 ADOConnection::GetArray()
 ADOConnection::GetAssoc()
 ADOConnection::GetCharSet()
 ADOConnection::GetCol()
 ADOConnection::GetInsertSQL()
 ADOConnection::GetOne()
 ADOConnection::GetRow()
 ADOConnection::GetUpdateSQL()
 ADOConnection::HasFailedTrans()
 ADOConnection::IfNull()
 ADOConnection::InParameter()
 ADOConnection::Insert_ID()
 ADOConnection::IsConnected()
 ADOConnection::LimitQuery()
 ADOConnection::LogSQL()
 ADOConnection::MetaColumnNames()
 ADOConnection::MetaColumns()
 ADOConnection::MetaDatabases()
 ADOConnection::MetaError()
 ADOConnection::MetaErrorMsg()
 ADOConnection::MetaForeignKeys()
 ADOConnection::MetaIndexes()
 ADOConnection::MetaPrimaryKeys()
 ADOConnection::MetaTables()
 ADOConnection::MetaType()
 ADOConnection::NConnect()
 ADOConnection::nextId()
 ADOConnection::OffsetDate()
 ADOConnection::outp()
 ADOConnection::OutParameter()
 ADOConnection::PageExecute()
 ADOConnection::Param()
 ADOConnection::Parameter()
 ADOConnection::PConnect()
 ADOConnection::PO_Insert_ID()
 ADOConnection::Prepare()
 ADOConnection::PrepareSP()
 ADOConnection::q()
 ADOConnection::QMagic()
 ADOConnection::qstr()
 ADOConnection::Query()
 ADOConnection::Quote()
 ADOConnection::Replace()
 ADOConnection::RollbackLock()
 ADOConnection::RollbackTrans()
 ADOConnection::RowLock()
 ADOConnection::SelectDB()
 ADOConnection::SelectLimit()
 ADOConnection::SerializableRS()
 ADOConnection::ServerInfo()
 ADOConnection::SetCharSet()
 ADOConnection::SetDateLocale()
 ADOConnection::SetFetchMode()
 ADOConnection::SQLDate()
 ADOConnection::StartTrans()
 ADOConnection::Time()
 ADOConnection::UnixDate()
 ADOConnection::UnixTimeStamp()
 ADOConnection::UpdateBlob()
 ADOConnection::UpdateBlobFile()
 ADOConnection::UpdateClob()
 ADOConnection::UserDate()
 ADOConnection::UserTimeStamp()
 ADOConnection::Version()
 ADOConnection::_Execute()
 ADOConnection::_findschema()
 ADOConnection::_findvers()
 ADOConnection::_gencachename()
 ADOConnection::_nconnect()
 ADOConnection::_rs2rs()

Documentation generated on Wed, 23 Jan 2008 19:33:42 -0500 by phpDocumentor 1.4.0