Öffentliche Methoden | |
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) | |
Datenfelder | |
$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() | |
Definiert in Zeile 55 der Datei adodb-oci8.inc.php.
_affectedrows | ( | ) |
Definiert in Zeile 276 der Datei adodb-oci8.inc.php.
_close | ( | ) |
Definiert in Zeile 1199 der Datei adodb-oci8.inc.php.
_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) |
Definiert in Zeile 194 der Datei adodb-oci8.inc.php.
Benutzt Execute().
Wird benutzt von _nconnect() und _pconnect().
_nconnect | ( | $argHostname, | |
$argUsername, | |||
$argPassword, | |||
$argDatabasename | |||
) |
Definiert in Zeile 271 der Datei adodb-oci8.inc.php.
Benutzt _connect().
_pconnect | ( | $argHostname, | |
$argUsername, | |||
$argPassword, | |||
$argDatabasename | |||
) |
Definiert in Zeile 265 der Datei adodb-oci8.inc.php.
Benutzt _connect().
_query | ( | $sql, | |
$inputarr = false |
|||
) |
returns query ID if successful, otherwise false this version supports:
Definiert in Zeile 1060 der Datei adodb-oci8.inc.php.
Benutzt $ok.
Wird benutzt von ADODB_oci8po\_query().
ADODB_oci8 | ( | ) |
Definiert in Zeile 105 der Datei adodb-oci8.inc.php.
Wird benutzt von ADODB_oci805\ADODB_oci805().
BeginTrans | ( | ) |
Definiert in Zeile 432 der Datei adodb-oci8.inc.php.
Wird benutzt von RowLock(), UpdateBlob() und UpdateBlobFile().
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
Definiert in Zeile 963 der Datei adodb-oci8.inc.php.
Benutzt oci_lob_desc().
Wird benutzt von Parameter().
BindDate | ( | $d) |
Definiert in Zeile 305 der Datei adodb-oci8.inc.php.
BindTimeStamp | ( | $ts) |
Definiert in Zeile 313 der Datei adodb-oci8.inc.php.
Benutzt adodb_date().
CharMax | ( | ) |
Definiert in Zeile 1300 der Datei adodb-oci8.inc.php.
CommitTrans | ( | $ok = true ) |
Definiert in Zeile 445 der Datei adodb-oci8.inc.php.
Benutzt $ok und RollbackTrans().
Wird benutzt von UpdateBlob() und UpdateBlobFile().
DBDate | ( | $d, | |
$isfld = false |
|||
) |
Definiert in Zeile 288 der Datei adodb-oci8.inc.php.
Benutzt adodb_date().
DBTimeStamp | ( | $ts, | |
$isfld = false |
|||
) |
Definiert in Zeile 325 der Datei adodb-oci8.inc.php.
Benutzt date.
ErrorMsg | ( | ) |
Definiert in Zeile 473 der Datei adodb-oci8.inc.php.
ErrorNo | ( | ) |
Definiert in Zeile 488 der Datei adodb-oci8.inc.php.
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. |
Definiert in Zeile 793 der Datei adodb-oci8.inc.php.
Benutzt $ok, _bindInputArray, Prepare() und qstr().
Wird benutzt von _connect(), BeginTrans(), ExecuteCursor(), MetaColumns(), MetaIndexes(), MetaPrimaryKeys(), SelectLimit(), Time(), UpdateBlob() und UpdateBlobFile().
ExecuteCursor | ( | $sql, | |
$cursorName = 'rs' , |
|||
$params = false |
|||
) |
Definiert in Zeile 909 der Datei adodb-oci8.inc.php.
Benutzt $params, Execute(), Parameter() und Prepare().
GetRandRow | ( | $sql, | |
$arr = false |
|||
) |
Definiert in Zeile 585 der Datei adodb-oci8.inc.php.
IfNull | ( | $field, | |
$ifNull | |||
) |
Definiert in Zeile 282 der Datei adodb-oci8.inc.php.
IsConnectionError | ( | $err) |
Definiert in Zeile 1173 der Datei adodb-oci8.inc.php.
MetaColumns | ( | $table, | |
$normalize = true |
|||
) |
Definiert in Zeile 112 der Datei adodb-oci8.inc.php.
Benutzt Execute().
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
Definiert in Zeile 1260 der Datei adodb-oci8.inc.php.
Benutzt qstr().
MetaIndexes | ( | $table, | |
$primary = FALSE , |
|||
$owner = false |
|||
) |
Definiert in Zeile 359 der Datei adodb-oci8.inc.php.
Benutzt Execute().
MetaPrimaryKeys | ( | $table, | |
$owner = false , |
|||
$internalKey = false |
|||
) |
Definiert in Zeile 1216 der Datei adodb-oci8.inc.php.
MetaTables | ( | $ttype = false , |
|
$showSchema = false , |
|||
$mask = false |
|||
) |
Definiert in Zeile 343 der Datei adodb-oci8.inc.php.
Benutzt $metaTablesSQL und qstr().
Param | ( | $name, | |
$type = 'C' |
|||
) |
Definiert in Zeile 1014 der Datei adodb-oci8.inc.php.
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
Definiert in Zeile 1035 der Datei adodb-oci8.inc.php.
Benutzt Bind().
Wird benutzt von ExecuteCursor().
Prepare | ( | $sql, | |
$cursor = false |
|||
) |
Definiert in Zeile 869 der Datei adodb-oci8.inc.php.
Wird benutzt von Execute(), ExecuteCursor(), ADODB_oci8po\Prepare() und SelectLimit().
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. |
Definiert in Zeile 1320 der Datei adodb-oci8.inc.php.
Wird benutzt von Execute(), MetaForeignKeys() und MetaTables().
RollbackTrans | ( | ) |
Definiert in Zeile 457 der Datei adodb-oci8.inc.php.
Wird benutzt von CommitTrans().
RowLock | ( | $tables, | |
$where, | |||
$col = '1 as adodbignore' |
|||
) |
Definiert in Zeile 337 der Datei adodb-oci8.inc.php.
Benutzt BeginTrans().
SelectDB | ( | $dbName) |
Definiert in Zeile 468 der Datei adodb-oci8.inc.php.
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.
Definiert in Zeile 608 der Datei adodb-oci8.inc.php.
Benutzt $result, Execute() und Prepare().
ServerInfo | ( | ) |
Definiert in Zeile 257 der Datei adodb-oci8.inc.php.
SQLDate | ( | $fmt, | |
$col = false |
|||
) |
Format date column in sql string given an input format that understands Y M D
Definiert in Zeile 508 der Datei adodb-oci8.inc.php.
Benutzt $sysTimeStamp.
TextMax | ( | ) |
Definiert in Zeile 1305 der Datei adodb-oci8.inc.php.
Time | ( | ) |
Definiert in Zeile 160 der Datei adodb-oci8.inc.php.
Benutzt Execute().
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...
Definiert in Zeile 726 der Datei adodb-oci8.inc.php.
Benutzt BeginTrans(), CommitTrans() und Execute().
UpdateBlobFile | ( | $table, | |
$column, | |||
$val, | |||
$where, | |||
$blobtype = 'BLOB' |
|||
) |
Usage: store file pointed to by $val in a blob
Definiert in Zeile 760 der Datei adodb-oci8.inc.php.
Benutzt BeginTrans(), CommitTrans() und Execute().
$_bind = false |
Definiert in Zeile 89 der Datei adodb-oci8.inc.php.
$_bindInputArray = true |
Definiert in Zeile 73 der Datei adodb-oci8.inc.php.
$_commit = OCI_COMMIT_ON_SUCCESS |
Definiert in Zeile 64 der Datei adodb-oci8.inc.php.
$_dropSeqSQL = "DROP SEQUENCE %s" |
Definiert in Zeile 84 der Datei adodb-oci8.inc.php.
$_genIDSQL = "SELECT (%s.nextval) FROM DUAL" |
Definiert in Zeile 75 der Datei adodb-oci8.inc.php.
$_genSeqSQL |
Definiert in Zeile 76 der Datei adodb-oci8.inc.php.
$_getarray = false |
Definiert in Zeile 92 der Datei adodb-oci8.inc.php.
$_hasOciFetchStatement = false |
Definiert in Zeile 91 der Datei adodb-oci8.inc.php.
$_initdate = true |
Definiert in Zeile 65 der Datei adodb-oci8.inc.php.
$_nestedSQL = true |
Definiert in Zeile 90 der Datei adodb-oci8.inc.php.
$_refLOBs = array() |
Definiert in Zeile 101 der Datei adodb-oci8.inc.php.
$_stmt |
Definiert in Zeile 63 der Datei adodb-oci8.inc.php.
$concat_operator ='||' |
Definiert in Zeile 59 der Datei adodb-oci8.inc.php.
$connectSID = false |
Definiert in Zeile 88 der Datei adodb-oci8.inc.php.
$databaseType = 'oci8' |
Definiert in Zeile 56 der Datei adodb-oci8.inc.php.
$dataProvider = 'oci8' |
Definiert in Zeile 57 der Datei adodb-oci8.inc.php.
$dateformat = 'YYYY-MM-DD' |
Definiert in Zeile 98 der Datei adodb-oci8.inc.php.
$datetime = false |
Definiert in Zeile 100 der Datei adodb-oci8.inc.php.
$firstrows = true |
Definiert in Zeile 95 der Datei adodb-oci8.inc.php.
$hasAffectedRows = true |
Definiert in Zeile 85 der Datei adodb-oci8.inc.php.
$hasGenID = true |
Definiert in Zeile 74 der Datei adodb-oci8.inc.php.
$leftOuter = '' |
Definiert in Zeile 93 der Datei adodb-oci8.inc.php.
$metaColumnsSQL = "select cname,coltype,width, SCALE, PRECISION, NULLS, DEFAULTVAL from col where tname='%s' order by colno" |
Definiert in Zeile 67 der Datei adodb-oci8.inc.php.
$metaColumnsSQL2 |
Definiert in Zeile 68 der Datei adodb-oci8.inc.php.
$metaDatabasesSQL = "SELECT USERNAME FROM ALL_USERS WHERE USERNAME NOT IN ('SYS','SYSTEM','DBSNMP','OUTLN') ORDER BY 1" |
Definiert in Zeile 62 der Datei adodb-oci8.inc.php.
$metaTablesSQL = "select table_name,table_type from cat where table_type in ('TABLE','VIEW') and table_name not like 'BIN\$%'" |
Definiert in Zeile 66 der Datei adodb-oci8.inc.php.
Wird benutzt von MetaTables().
$NLS_DATE_FORMAT = 'YYYY-MM-DD' |
Definiert in Zeile 97 der Datei adodb-oci8.inc.php.
$noNullStrings = false |
Definiert in Zeile 87 der Datei adodb-oci8.inc.php.
$random = "abs(mod(DBMS_RANDOM.RANDOM,10000001)/10000000)" |
Definiert in Zeile 86 der Datei adodb-oci8.inc.php.
$replaceQuote = "''" |
Definiert in Zeile 58 der Datei adodb-oci8.inc.php.
$selectOffsetAlg1 = 1000 |
Definiert in Zeile 96 der Datei adodb-oci8.inc.php.
$session_sharing_force_blob = false |
Definiert in Zeile 94 der Datei adodb-oci8.inc.php.
$sysDate = "TRUNC(SYSDATE)" |
Definiert in Zeile 60 der Datei adodb-oci8.inc.php.
$sysTimeStamp = 'SYSDATE' |
Definiert in Zeile 61 der Datei adodb-oci8.inc.php.
Wird benutzt von SQLDate().
$useDBDateFormatForTextInput =false |
Definiert in Zeile 99 der Datei adodb-oci8.inc.php.