From 93792e60746f8d34fa675ba834ca36552f6016df Mon Sep 17 00:00:00 2001 From: Daniel Date: Mon, 9 Dec 2013 02:04:04 -0500 Subject: Support for all PRADO DB drivers! --- framework/Data/Common/Oracle/TOracleMetaData.php | 38 +++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) (limited to 'framework/Data/Common/Oracle/TOracleMetaData.php') diff --git a/framework/Data/Common/Oracle/TOracleMetaData.php b/framework/Data/Common/Oracle/TOracleMetaData.php index 6f495aeb..7b5bd195 100644 --- a/framework/Data/Common/Oracle/TOracleMetaData.php +++ b/framework/Data/Common/Oracle/TOracleMetaData.php @@ -334,5 +334,41 @@ EOD; } return false; } -} + + /** + * Returns all table names in the database. + * @param string $schema the schema of the tables. Defaults to empty string, meaning the current or default schema. + * If not empty, the returned table names will be prefixed with the schema name. + * @return array all table names in the database. + */ + public function findTableNames($schema='') + { + if($schema==='') + { + $sql=<<getDbConnection()->createCommand($sql); + } + else + { + $sql=<<getDbConnection()->createCommand($sql); + $command->bindParam(':schema',$schema); + } + $rows=$command->queryAll(); + $names=array(); + foreach($rows as $row) + { + if($schema===$this->getDefaultSchema() || $schema==='') + $names[]=$row['TABLE_NAME']; + else + $names[]=$row['TABLE_SCHEMA'].'.'.$row['TABLE_NAME']; + } + return $names; + } +} -- cgit v1.2.3