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:
rylek 2009-12-21 22:43:44 +00:00
parent a4f69d2da4
commit 1f04877186
3 changed files with 11 additions and 2 deletions

View file

@ -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;
}

View file

@ -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

Binary file not shown.