TYPO3 CMS
TYPO3_6-2
|
Public Member Functions | |
ADODB_oci8 () | |
MetaColumns ($table, $normalize=true) | |
Time () | |
_connect ($argHostname, $argUsername, $argPassword, $argDatabasename=null, $mode=0) | |
ServerInfo () | |
_pconnect ($argHostname, $argUsername, $argPassword, $argDatabasename) | |
_nconnect ($argHostname, $argUsername, $argPassword, $argDatabasename) | |
_affectedrows () | |
IfNull ( $field, $ifNull) | |
DBDate ($d, $isfld=false) | |
BindDate ($d) | |
BindTimeStamp ($ts) | |
DBTimeStamp ($ts, $isfld=false) | |
RowLock ($tables, $where, $col='1 as adodbignore') | |
MetaTables ($ttype=false, $showSchema=false, $mask=false) | |
MetaIndexes ($table, $primary=FALSE, $owner=false) | |
BeginTrans () | |
CommitTrans ($ok=true) | |
RollbackTrans () | |
SelectDB ($dbName) | |
ErrorMsg () | |
ErrorNo () | |
SQLDate ($fmt, $col=false) | |
GetRandRow ($sql, $arr=false) | |
SelectLimit ($sql, $nrows=-1, $offset=-1, $inputarr=false, $secs2cache=0) | |
UpdateBlob ($table, $column, $val, $where, $blobtype='BLOB') | |
UpdateBlobFile ($table, $column, $val, $where, $blobtype='BLOB') | |
Execute ($sql, $inputarr=false) | |
Prepare ($sql, $cursor=false) | |
ExecuteCursor ($sql, $cursorName='rs', $params=false) | |
Bind (&$stmt, &$var, $size=4000, $type=false, $name=false, $isOutput=false) | |
Param ($name, $type='C') | |
Parameter (&$stmt, &$var, $name, $isOutput=false, $maxLen=4000, $type=false) | |
_query ($sql, $inputarr=false) | |
IsConnectionError ($err) | |
_close () | |
MetaPrimaryKeys ($table, $owner=false, $internalKey=false) | |
MetaForeignKeys ($table, $owner=false, $upper=false) | |
CharMax () | |
TextMax () | |
qstr ($s, $magic_quotes=false) | |
Public Attributes | |
$databaseType = 'oci8' | |
$dataProvider = 'oci8' | |
$replaceQuote = "''" | |
$concat_operator ='||' | |
$sysDate = "TRUNC(SYSDATE)" | |
$sysTimeStamp = 'SYSDATE' | |
$metaDatabasesSQL = "SELECT USERNAME FROM ALL_USERS WHERE USERNAME NOT IN ('SYS','SYSTEM','DBSNMP','OUTLN') ORDER BY 1" | |
$_stmt | |
$_commit = OCI_COMMIT_ON_SUCCESS | |
$_initdate = true | |
$metaTablesSQL = "select table_name,table_type from cat where table_type in ('TABLE','VIEW') and table_name not like 'BIN\$%'" | |
$metaColumnsSQL = "select cname,coltype,width, SCALE, PRECISION, NULLS, DEFAULTVAL from col where tname='%s' order by colno" | |
$metaColumnsSQL2 | |
$_bindInputArray = true | |
$hasGenID = true | |
$_genIDSQL = "SELECT (%s.nextval) FROM DUAL" | |
$_genSeqSQL | |
$_dropSeqSQL = "DROP SEQUENCE %s" | |
$hasAffectedRows = true | |
$random = "abs(mod(DBMS_RANDOM.RANDOM,10000001)/10000000)" | |
$noNullStrings = false | |
$connectSID = false | |
$_bind = false | |
$_nestedSQL = true | |
$_hasOciFetchStatement = false | |
$_getarray = false | |
$leftOuter = '' | |
$session_sharing_force_blob = false | |
$firstrows = true | |
$selectOffsetAlg1 = 1000 | |
$NLS_DATE_FORMAT = 'YYYY-MM-DD' | |
$dateformat = 'YYYY-MM-DD' | |
$useDBDateFormatForTextInput =false | |
$datetime = false | |
$_refLOBs = array() | |
Definition at line 55 of file adodb-oci8.inc.php.
ADODB_oci8::_affectedrows | ( | ) |
Definition at line 276 of file adodb-oci8.inc.php.
ADODB_oci8::_close | ( | ) |
Definition at line 1199 of file adodb-oci8.inc.php.
ADODB_oci8::_connect | ( | $argHostname, | |
$argUsername, | |||
$argPassword, | |||
$argDatabasename = null , |
|||
$mode = 0 |
|||
) |
Multiple modes of connection are supported:
a. Local Database $conn->Connect(false,'scott','tiger');
b. From tnsnames.ora $conn->Connect($tnsname,'scott','tiger'); $conn->Connect(false,'scott','tiger',$tnsname);
c. Server + service name $conn->Connect($serveraddress,'scott,'tiger',$service_name);
d. Server + SID $conn->connectSID = true; $conn->Connect($serveraddress,'scott,'tiger',$SID);
string | false | $argHostname | DB server hostname or TNS name |
string | $argUsername | |
string | $argPassword | |
string | $argDatabasename | Service name, SID (defaults to null) |
int | $mode | Connection mode, defaults to 0 (0 = non-persistent, 1 = persistent, 2 = force new connection) |
Definition at line 194 of file adodb-oci8.inc.php.
References Execute().
Referenced by _nconnect(), and _pconnect().
ADODB_oci8::_nconnect | ( | $argHostname, | |
$argUsername, | |||
$argPassword, | |||
$argDatabasename | |||
) |
Definition at line 271 of file adodb-oci8.inc.php.
References _connect().
ADODB_oci8::_pconnect | ( | $argHostname, | |
$argUsername, | |||
$argPassword, | |||
$argDatabasename | |||
) |
Definition at line 265 of file adodb-oci8.inc.php.
References _connect().
ADODB_oci8::_query | ( | $sql, | |
$inputarr = false |
|||
) |
returns query ID if successful, otherwise false this version supports:
Definition at line 1060 of file adodb-oci8.inc.php.
Referenced by ADODB_oci8po\_query().
ADODB_oci8::ADODB_oci8 | ( | ) |
Definition at line 105 of file adodb-oci8.inc.php.
Referenced by ADODB_oci805\ADODB_oci805().
ADODB_oci8::BeginTrans | ( | ) |
Definition at line 432 of file adodb-oci8.inc.php.
References Execute().
Referenced by RowLock(), UpdateBlob(), and UpdateBlobFile().
ADODB_oci8::Bind | ( | & | $stmt, |
& | $var, | ||
$size = 4000 , |
|||
$type = false , |
|||
$name = false , |
|||
$isOutput = false |
|||
) |
Bind a variable – very, very fast for executing repeated statements in oracle.
Better than using for ($i = 0; $i < $max; $i++) { $p1 = ?; $p2 = ?; $p3 = ?; $this->Execute("insert into table (col0, col1, col2) values (:0, :1, :2)", array($p1,$p2,$p3)); }
Usage: $stmt = $DB->Prepare("insert into table (col0, col1, col2) values (:0, :1, :2)"); $DB->Bind($stmt, $p1); $DB->Bind($stmt, $p2); $DB->Bind($stmt, $p3); for ($i = 0; $i < $max; $i++) { $p1 = ?; $p2 = ?; $p3 = ?; $DB->Execute($stmt); }
Some timings to insert 1000 records, test table has 3 cols, and 1 index.
Now if PHP only had batch/bulk updating like Java or PL/SQL...
Note that the order of parameters differs from oci_bind_by_name, because we default the names to :0, :1, :2
Definition at line 963 of file adodb-oci8.inc.php.
References debug(), and oci_lob_desc().
Referenced by Parameter().
ADODB_oci8::BindDate | ( | $d | ) |
Definition at line 305 of file adodb-oci8.inc.php.
ADODB_oci8::BindTimeStamp | ( | $ts | ) |
Definition at line 313 of file adodb-oci8.inc.php.
References adodb_date().
ADODB_oci8::CharMax | ( | ) |
Definition at line 1300 of file adodb-oci8.inc.php.
ADODB_oci8::CommitTrans | ( | $ok = true | ) |
Definition at line 445 of file adodb-oci8.inc.php.
References RollbackTrans().
Referenced by UpdateBlob(), and UpdateBlobFile().
ADODB_oci8::DBDate | ( | $d, | |
$isfld = false |
|||
) |
Definition at line 288 of file adodb-oci8.inc.php.
References adodb_date().
ADODB_oci8::DBTimeStamp | ( | $ts, | |
$isfld = false |
|||
) |
Definition at line 325 of file adodb-oci8.inc.php.
ADODB_oci8::ErrorMsg | ( | ) |
Definition at line 473 of file adodb-oci8.inc.php.
ADODB_oci8::ErrorNo | ( | ) |
Definition at line 488 of file adodb-oci8.inc.php.
ADODB_oci8::Execute | ( | $sql, | |
$inputarr = false |
|||
) |
Execute SQL
sql | SQL statement to execute, or possibly an array holding prepared statement ($sql[0] will hold sql text) |
[inputarr] | holds the input data to bind to. Null elements will be set to null. |
Definition at line 793 of file adodb-oci8.inc.php.
References $sql, Prepare(), and qstr().
Referenced by _connect(), BeginTrans(), ExecuteCursor(), MetaColumns(), MetaIndexes(), MetaPrimaryKeys(), SelectLimit(), Time(), UpdateBlob(), and UpdateBlobFile().
ADODB_oci8::ExecuteCursor | ( | $sql, | |
$cursorName = 'rs' , |
|||
$params = false |
|||
) |
Definition at line 909 of file adodb-oci8.inc.php.
References $rs, $sql, Execute(), Parameter(), and Prepare().
ADODB_oci8::GetRandRow | ( | $sql, | |
$arr = false |
|||
) |
Definition at line 585 of file adodb-oci8.inc.php.
References $sql.
ADODB_oci8::IfNull | ( | $field, | |
$ifNull | |||
) |
Definition at line 282 of file adodb-oci8.inc.php.
ADODB_oci8::IsConnectionError | ( | $err | ) |
Definition at line 1173 of file adodb-oci8.inc.php.
ADODB_oci8::MetaColumns | ( | $table, | |
$normalize = true |
|||
) |
Definition at line 112 of file adodb-oci8.inc.php.
ADODB_oci8::MetaForeignKeys | ( | $table, | |
$owner = false , |
|||
$upper = false |
|||
) |
returns assoc array where keys are tables, and values are foreign keys
str | $table | |
str | $owner | [optional][default=NULL] |
bool | $upper | [optional][discarded] |
http://gis.mit.edu/classes/11.521/sqlnotes/referential_integrity.html
Definition at line 1260 of file adodb-oci8.inc.php.
ADODB_oci8::MetaIndexes | ( | $table, | |
$primary = FALSE , |
|||
$owner = false |
|||
) |
Definition at line 359 of file adodb-oci8.inc.php.
ADODB_oci8::MetaPrimaryKeys | ( | $table, | |
$owner = false , |
|||
$internalKey = false |
|||
) |
Definition at line 1216 of file adodb-oci8.inc.php.
ADODB_oci8::MetaTables | ( | $ttype = false , |
|
$showSchema = false , |
|||
$mask = false |
|||
) |
Definition at line 343 of file adodb-oci8.inc.php.
References $metaTablesSQL, and qstr().
ADODB_oci8::Param | ( | $name, | |
$type = 'C' |
|||
) |
Definition at line 1014 of file adodb-oci8.inc.php.
ADODB_oci8::Parameter | ( | & | $stmt, |
& | $var, | ||
$name, | |||
$isOutput = false , |
|||
$maxLen = 4000 , |
|||
$type = false |
|||
) |
Usage: $stmt = $db->Prepare('select * from table where id =:myid and group=:group'); $db->Parameter($stmt,$id,'myid'); $db->Parameter($stmt,$group,'group'); $db->Execute($stmt);
$stmt | Statement returned by Prepare() or PrepareSP(). |
$var | PHP variable to bind to |
$name | Name of stored procedure variable name to bind to. |
[$isOutput] | Indicates direction of parameter 0/false=IN 1=OUT 2= IN/OUT. This is ignored in oci8. |
[$maxLen] | Holds an maximum length of the variable. |
[$type] | The data type of $var. Legal values depend on driver. |
http://php.net/oci_bind_by_name
Definition at line 1035 of file adodb-oci8.inc.php.
References Bind(), and debug().
Referenced by ExecuteCursor().
ADODB_oci8::Prepare | ( | $sql, | |
$cursor = false |
|||
) |
Definition at line 869 of file adodb-oci8.inc.php.
References $sql.
Referenced by Execute(), ExecuteCursor(), ADODB_oci8po\Prepare(), and SelectLimit().
ADODB_oci8::qstr | ( | $s, | |
$magic_quotes = false |
|||
) |
Quotes a string. An example is $db->qstr("Don't bother",magic_quotes_runtime());
string | $s | the string to quote |
bool | $magic_quotes | if $s is GET/POST var, set to get_magic_quotes_gpc(). This undoes the stupidity of magic quotes for GPC. |
Definition at line 1320 of file adodb-oci8.inc.php.
Referenced by Execute(), MetaForeignKeys(), and MetaTables().
ADODB_oci8::RollbackTrans | ( | ) |
Definition at line 457 of file adodb-oci8.inc.php.
Referenced by CommitTrans().
ADODB_oci8::RowLock | ( | $tables, | |
$where, | |||
$col = '1 as adodbignore' |
|||
) |
Definition at line 337 of file adodb-oci8.inc.php.
References BeginTrans().
ADODB_oci8::SelectDB | ( | $dbName | ) |
Definition at line 468 of file adodb-oci8.inc.php.
ADODB_oci8::SelectLimit | ( | $sql, | |
$nrows = -1 , |
|||
$offset = -1 , |
|||
$inputarr = false , |
|||
$secs2cache = 0 |
|||
) |
This algorithm makes use of
a. FIRST_ROWS hint The FIRST_ROWS hint explicitly chooses the approach to optimize response time, that is, minimum resource usage to return the first row. Results will be returned as soon as they are identified.
b. Uses rownum tricks to obtain only the required rows from a given offset. As this uses complicated sql statements, we only use this if $offset >= 100. This idea by Tomas V V Cox.
This implementation does not appear to work with oracle 8.0.5 or earlier. Comment out this function then, and the slower SelectLimit() in the base class will be used.
Definition at line 608 of file adodb-oci8.inc.php.
ADODB_oci8::ServerInfo | ( | ) |
Definition at line 257 of file adodb-oci8.inc.php.
ADODB_oci8::SQLDate | ( | $fmt, | |
$col = false |
|||
) |
Format date column in sql string given an input format that understands Y M D
Definition at line 508 of file adodb-oci8.inc.php.
References $sysTimeStamp.
ADODB_oci8::TextMax | ( | ) |
Definition at line 1305 of file adodb-oci8.inc.php.
ADODB_oci8::Time | ( | ) |
Definition at line 160 of file adodb-oci8.inc.php.
ADODB_oci8::UpdateBlob | ( | $table, | |
$column, | |||
$val, | |||
$where, | |||
$blobtype = 'BLOB' |
|||
) |
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...
Definition at line 726 of file adodb-oci8.inc.php.
References $rs, $sql, BeginTrans(), CommitTrans(), and Execute().
ADODB_oci8::UpdateBlobFile | ( | $table, | |
$column, | |||
$val, | |||
$where, | |||
$blobtype = 'BLOB' |
|||
) |
Usage: store file pointed to by $val in a blob
Definition at line 760 of file adodb-oci8.inc.php.
References $rs, $sql, BeginTrans(), CommitTrans(), and Execute().
ADODB_oci8::$_bind = false |
Definition at line 89 of file adodb-oci8.inc.php.
ADODB_oci8::$_bindInputArray = true |
Definition at line 73 of file adodb-oci8.inc.php.
ADODB_oci8::$_commit = OCI_COMMIT_ON_SUCCESS |
Definition at line 64 of file adodb-oci8.inc.php.
ADODB_oci8::$_dropSeqSQL = "DROP SEQUENCE %s" |
Definition at line 84 of file adodb-oci8.inc.php.
ADODB_oci8::$_genIDSQL = "SELECT (%s.nextval) FROM DUAL" |
Definition at line 75 of file adodb-oci8.inc.php.
ADODB_oci8::$_genSeqSQL |
Definition at line 76 of file adodb-oci8.inc.php.
ADODB_oci8::$_getarray = false |
Definition at line 92 of file adodb-oci8.inc.php.
ADODB_oci8::$_hasOciFetchStatement = false |
Definition at line 91 of file adodb-oci8.inc.php.
ADODB_oci8::$_initdate = true |
Definition at line 65 of file adodb-oci8.inc.php.
ADODB_oci8::$_nestedSQL = true |
Definition at line 90 of file adodb-oci8.inc.php.
ADODB_oci8::$_refLOBs = array() |
Definition at line 101 of file adodb-oci8.inc.php.
ADODB_oci8::$_stmt |
Definition at line 63 of file adodb-oci8.inc.php.
ADODB_oci8::$concat_operator ='||' |
Definition at line 59 of file adodb-oci8.inc.php.
ADODB_oci8::$connectSID = false |
Definition at line 88 of file adodb-oci8.inc.php.
ADODB_oci8::$databaseType = 'oci8' |
Definition at line 56 of file adodb-oci8.inc.php.
ADODB_oci8::$dataProvider = 'oci8' |
Definition at line 57 of file adodb-oci8.inc.php.
ADODB_oci8::$dateformat = 'YYYY-MM-DD' |
Definition at line 98 of file adodb-oci8.inc.php.
ADODB_oci8::$datetime = false |
Definition at line 100 of file adodb-oci8.inc.php.
ADODB_oci8::$firstrows = true |
Definition at line 95 of file adodb-oci8.inc.php.
ADODB_oci8::$hasAffectedRows = true |
Definition at line 85 of file adodb-oci8.inc.php.
ADODB_oci8::$hasGenID = true |
Definition at line 74 of file adodb-oci8.inc.php.
ADODB_oci8::$leftOuter = '' |
Definition at line 93 of file adodb-oci8.inc.php.
ADODB_oci8::$metaColumnsSQL = "select cname,coltype,width, SCALE, PRECISION, NULLS, DEFAULTVAL from col where tname='%s' order by colno" |
Definition at line 67 of file adodb-oci8.inc.php.
ADODB_oci8::$metaColumnsSQL2 |
Definition at line 68 of file adodb-oci8.inc.php.
ADODB_oci8::$metaDatabasesSQL = "SELECT USERNAME FROM ALL_USERS WHERE USERNAME NOT IN ('SYS','SYSTEM','DBSNMP','OUTLN') ORDER BY 1" |
Definition at line 62 of file adodb-oci8.inc.php.
ADODB_oci8::$metaTablesSQL = "select table_name,table_type from cat where table_type in ('TABLE','VIEW') and table_name not like 'BIN\$%'" |
Definition at line 66 of file adodb-oci8.inc.php.
Referenced by MetaTables().
ADODB_oci8::$NLS_DATE_FORMAT = 'YYYY-MM-DD' |
Definition at line 97 of file adodb-oci8.inc.php.
ADODB_oci8::$noNullStrings = false |
Definition at line 87 of file adodb-oci8.inc.php.
ADODB_oci8::$random = "abs(mod(DBMS_RANDOM.RANDOM,10000001)/10000000)" |
Definition at line 86 of file adodb-oci8.inc.php.
ADODB_oci8::$replaceQuote = "''" |
Definition at line 58 of file adodb-oci8.inc.php.
ADODB_oci8::$selectOffsetAlg1 = 1000 |
Definition at line 96 of file adodb-oci8.inc.php.
ADODB_oci8::$session_sharing_force_blob = false |
Definition at line 94 of file adodb-oci8.inc.php.
ADODB_oci8::$sysDate = "TRUNC(SYSDATE)" |
Definition at line 60 of file adodb-oci8.inc.php.
ADODB_oci8::$sysTimeStamp = 'SYSDATE' |
Definition at line 61 of file adodb-oci8.inc.php.
Referenced by SQLDate().
ADODB_oci8::$useDBDateFormatForTextInput =false |
Definition at line 99 of file adodb-oci8.inc.php.