Commit f84d4429 authored by Steve Müller's avatar Steve Müller

Merge pull request #396 from darkindex/DBAL-645

DBAL-645: Oracle Platform: Cannot list table columns from a different schema
parents e4d1084b cc012b68
......@@ -541,16 +541,18 @@ LEFT JOIN user_cons_columns r_cols
$table = strtoupper($table);
$tabColumnsTableName = "user_tab_columns";
$colCommentsTableName = "user_col_comments";
$ownerCondition = '';
if (null !== $database){
$database = strtoupper($database);
$tabColumnsTableName = "all_tab_columns";
$colCommentsTableName = "all_col_comments";
$ownerCondition = "AND c.owner = '".$database."'";
}
return "SELECT c.*, d.comments FROM $tabColumnsTableName c ".
"INNER JOIN user_col_comments d ON d.TABLE_NAME = c.TABLE_NAME AND d.COLUMN_NAME = c.COLUMN_NAME ".
"INNER JOIN " . $colCommentsTableName . " d ON d.TABLE_NAME = c.TABLE_NAME AND d.COLUMN_NAME = c.COLUMN_NAME ".
"WHERE c.table_name = '" . $table . "' ".$ownerCondition." ORDER BY c.column_name";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment