Public Member Functions | |
__construct (Connection $conn) | |
getSchema () | |
Protected Member Functions | |
initTables () | |
initSequences () | |
Oracle supports sequences. | |
Private Attributes | |
$schema |
Definition at line 31 of file OCI8DatabaseInfo.php.
OCI8DatabaseInfo::__construct | ( | Connection $ | conn | ) |
Definition at line 35 of file OCI8DatabaseInfo.php.
References Connection::getDSN().
00035 { 00036 parent::__construct($conn); 00037 00038 $dsn = $conn->getDSN(); 00039 00040 if (isset($dsn['schema'])) { 00041 $this->schema = $dsn['schema']; 00042 } else { 00043 // For Changing DB/Schema in Meta Data Interface 00044 $this->schema = $dsn['username']; 00045 } 00046 00047 $this->schema = strtoupper( $this->schema ); 00048 }
OCI8DatabaseInfo::getSchema | ( | ) |
OCI8DatabaseInfo::initSequences | ( | ) | [protected] |
Oracle supports sequences.
SQLException |
Reimplemented from DatabaseInfo.
Definition at line 85 of file OCI8DatabaseInfo.php.
OCI8DatabaseInfo::initTables | ( | ) | [protected] |
SQLException |
Reimplemented from DatabaseInfo.
Definition at line 58 of file OCI8DatabaseInfo.php.
00059 { 00060 include_once 'creole/drivers/oracle/metadata/OCI8TableInfo.php'; 00061 00062 $sql = "SELECT table_name 00063 FROM all_tables 00064 WHERE owner = '{$this->schema}'"; 00065 00066 $statement = @oci_parse($this->conn->getResource(),$sql); 00067 00068 $success = @oci_execute($statement,OCI_DEFAULT); 00069 if (!$success) { 00070 throw new SQLException("Could not get tables", $this->conn->getResource()->nativeError($statement)); 00071 } 00072 while ( $statement && $row = oci_fetch_assoc( $statement ) ) 00073 { 00074 $row = array_change_key_case($row,CASE_LOWER); 00075 $this->tables[strtoupper($row['table_name'])] = new OCI8TableInfo($this,$row['table_name']); 00076 } 00077 }
OCI8DatabaseInfo::$schema [private] |
Definition at line 33 of file OCI8DatabaseInfo.php.