mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
Minor fixes in Oracle schema metadata functions.
git-svn-id: svn://ultimatepp.org/upp/trunk@1828 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
a4f69d2da4
commit
1f04877186
3 changed files with 11 additions and 2 deletions
|
|
@ -270,7 +270,12 @@ Vector<String> OracleSchemaUsers(Sql& cursor)
|
|||
Vector<String> OracleSchemaTables(Sql& cursor, String database)
|
||||
{
|
||||
Vector<String> out;
|
||||
if(Select(SqlId("TABLE_NAME")).From(SqlId("ALL_TABLES")).Where(SqlId("OWNER") == database).Execute(cursor))
|
||||
SqlSelect sel;
|
||||
if(!IsNull(database))
|
||||
sel = Select(SqlId("TABLE_NAME")).From(SqlId("ALL_TABLES")).Where(SqlId("OWNER") == database);
|
||||
else
|
||||
sel = Select(SqlId("TABLE_NAME")).From(SqlId("USER_TABLES"));
|
||||
if(sel.Execute(cursor))
|
||||
out = FetchList(cursor);
|
||||
return out;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -645,7 +645,11 @@ Vector<SqlColumnInfo> SqlSession::EnumColumns(String database, String table)
|
|||
Vector<SqlColumnInfo> info;
|
||||
SqlBool none;
|
||||
none.SetFalse();
|
||||
if(cursor.Execute(Select(SqlAll()).From(SqlSet(SqlCol(database + '.' + table))).Where(none))) {
|
||||
String full_name = database;
|
||||
if(!IsNull(database))
|
||||
full_name << '.';
|
||||
full_name << table;
|
||||
if(cursor.Execute(Select(SqlAll()).From(SqlSet(SqlCol(full_name))).Where(none))) {
|
||||
info.SetCount(cursor.GetColumns());
|
||||
for(int i = 0; i < info.GetCount(); i++)
|
||||
info[i] = cursor.GetColumnInfo(i);
|
||||
|
|
|
|||
BIN
uppsrc/TCore/SqlConsole.cfg
Normal file
BIN
uppsrc/TCore/SqlConsole.cfg
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue