Commit 0a73cb53 authored by lucassouza1's avatar lucassouza1

Filter table columns by owner

parent 48c78a2d
...@@ -464,9 +464,16 @@ LEFT JOIN all_cons_columns r_cols ...@@ -464,9 +464,16 @@ LEFT JOIN all_cons_columns r_cols
public function getListTableColumnsSQL($table, $database = null) public function getListTableColumnsSQL($table, $database = null)
{ {
$table = strtoupper($table); $table = strtoupper($table);
$ownerCondition = '';
if(null !== $database){
$database = strtoupper($database);
$ownerCondition = "AND c.owner = '".$database."'";
}
return "SELECT c.*, d.comments FROM all_tab_columns c ". return "SELECT c.*, d.comments FROM all_tab_columns c ".
"INNER JOIN all_col_comments d ON d.OWNER = c.OWNER AND d.TABLE_NAME = c.TABLE_NAME AND d.COLUMN_NAME = c.COLUMN_NAME ". "INNER JOIN all_col_comments d ON d.OWNER = c.OWNER AND d.TABLE_NAME = c.TABLE_NAME AND d.COLUMN_NAME = c.COLUMN_NAME ".
"WHERE c.table_name = '" . $table . "' ORDER BY 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