|
Adodb Dokumentation
V5.14 8 Sept 2011
|


Öffentliche Methoden | |
| MetaType ($t, $len=-1) | |
| ActualType ($meta) | |
| CreateDatabase ($dbname, $options=false) | |
| AddColumnSQL ($tabname, $flds) | |
| AlterColumnSQL ($tabname, $flds) | |
| DropColumnSQL ($tabname, $flds) | |
| _DropAutoIncrement ($t) | |
| _CreateSuffix ($fname, &$ftype, $fnotnull, $fdefault, $fautoinc, $fconstraint, $funsigned) | |
| _Triggers ($tabname, $tableoptions) | |
| _IndexSQL ($idxname, $tabname, $flds, $idxoptions) | |
| GetCommentSQL ($table, $col) | |
| in other words, we use a text area for editting. | |
| SetCommentSQL ($table, $col, $cmt) | |
Datenfelder | |
| $databaseType = 'oci8' | |
| $seqField = false | |
| $seqPrefix = 'SEQ_' | |
| $dropTable = "DROP TABLE %s CASCADE CONSTRAINTS" | |
| $trigPrefix = 'TRIG_' | |
| $alterCol = ' MODIFY ' | |
| $typeX = 'VARCHAR(4000)' | |
| $typeXL = 'CLOB' | |
Definiert in Zeile 16 der Datei datadict-oci8.inc.php.
| _Triggers | ( | $ | tabname, |
| $ | taboptions | ||
| ) |
GENERATE TRIGGERS IF NEEDED used when table has auto-incrementing field that is emulated using triggers
Erneute Implementation von ADODB_DataDict.
Definiert in Zeile 192 der Datei datadict-oci8.inc.php.
{
if (!$this->seqField) return array();
if ($this->schema) {
$t = strpos($tabname,'.');
if ($t !== false) $tab = substr($tabname,$t+1);
else $tab = $tabname;
$seqname = $this->schema.'.'.$this->seqPrefix.$tab;
$trigname = $this->schema.'.'.$this->trigPrefix.$this->seqPrefix.$tab;
} else {
$seqname = $this->seqPrefix.$tabname;
$trigname = $this->trigPrefix.$seqname;
}
if (strlen($seqname) > 30) {
$seqname = $this->seqPrefix.uniqid('');
} // end if
if (strlen($trigname) > 30) {
$trigname = $this->trigPrefix.uniqid('');
} // end if
if (isset($tableoptions['REPLACE'])) $sql[] = "DROP SEQUENCE $seqname";
$seqCache = '';
if (isset($tableoptions['SEQUENCE_CACHE'])){$seqCache = $tableoptions['SEQUENCE_CACHE'];}
$seqIncr = '';
if (isset($tableoptions['SEQUENCE_INCREMENT'])){$seqIncr = ' INCREMENT BY '.$tableoptions['SEQUENCE_INCREMENT'];}
$seqStart = '';
if (isset($tableoptions['SEQUENCE_START'])){$seqIncr = ' START WITH '.$tableoptions['SEQUENCE_START'];}
$sql[] = "CREATE SEQUENCE $seqname $seqStart $seqIncr $seqCache";
$sql[] = "CREATE OR REPLACE TRIGGER $trigname BEFORE insert ON $tabname FOR EACH ROW WHEN (NEW.$this->seqField IS NULL OR NEW.$this->seqField = 0) BEGIN select $seqname.nextval into :new.$this->seqField from dual; END;";
$this->seqField = false;
return $sql;
}
| ActualType | ( | $ | meta | ) |
Returns the actual type given a character code.
C: varchar X: CLOB (character large object) or largest varchar size if CLOB is not supported C2: Multibyte varchar X2: Multibyte CLOB
B: BLOB (binary large object)
D: Date T: Date-time L: Integer field suitable for storing booleans (0 or 1) I: Integer F: Floating point number N: Numeric or decimal number
Erneute Implementation von ADODB_DataDict.
Definiert in Zeile 74 der Datei datadict-oci8.inc.php.
{
switch($meta) {
case 'C': return 'VARCHAR';
case 'X': return $this->typeX;
case 'XL': return $this->typeXL;
case 'C2': return 'NVARCHAR2';
case 'X2': return 'NVARCHAR2(4000)';
case 'B': return 'BLOB';
case 'TS':
return 'TIMESTAMP';
case 'D':
case 'T': return 'DATE';
case 'L': return 'NUMBER(1)';
case 'I1': return 'NUMBER(3)';
case 'I2': return 'NUMBER(5)';
case 'I':
case 'I4': return 'NUMBER(10)';
case 'I8': return 'NUMBER(20)';
case 'F': return 'NUMBER';
case 'N': return 'NUMBER';
case 'R': return 'NUMBER(20)';
default:
return $meta;
}
}
| GetCommentSQL | ( | $ | table, |
| $ | col | ||
| ) |
in other words, we use a text area for editting.
any varchar/char field this size or greater is treated as a blob
Erneute Implementation von ADODB_DataDict.
Definiert in Zeile 284 der Datei datadict-oci8.inc.php.
{
$table = $this->connection->qstr($table);
$col = $this->connection->qstr($col);
return "select comments from USER_COL_COMMENTS where TABLE_NAME=$table and COLUMN_NAME=$col";
}