Hi,
I think this is result of this query :
select 'TABLE' as table_type from dual
union select 'VIEW' as table_type from dual
union select 'SYNONYM' as table_type from dual;
On my database i found :
SYNONYM ;
TABLE ;
VIEW ;
this string is put in tableTypes and when this is used as :
SELECT NULL AS table_cat,
o.owner AS table_schem,
o.object_name AS table_name,
o.object_type AS table_type,
NULL AS remarks
FROM all_objects o
WHERE o.owner LIKE ? ESCAPE '/'
AND o.object_name LIKE ? ESCAPE '/'
AND o.object_type IN ('xxx', 'VIEW ')
ORDER BY table_type, table_schem, table_name
That dont go.
Bye
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have tested this query on my db and it works...(note that in your prev post there is a space in 'VIEW ')
SELECT NULL AS table_cat,
o.owner AS table_schem,
o.object_name AS table_name,
o.object_type AS table_type,
NULL AS remarks
FROM all_objects o
WHERE o.object_type IN ('VIEW','TABLE')
ORDER BY table_type, table_schem, table_name;
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello, very interressant project, good work.
But on windows "Metadata explorer", I see nothing in tree "Table" of my database (oracle). This is only visible in tree "All".
Comparatively I see that in Eclispe plugin Quantum DB.
Thank's.
Damien
hi,
some questions:
what version of oracle?
what driver jdbc(and version) or odbc?
thanks, nicky
Hi,
Oracle version is noted as 9.2.0.6.0 and
Driver version as 9.2.0.3.0
Perhaps this problem is the same as :
Cant get list of tables/views using Sybase
described at this page :
http://sourceforge.net/tracker/index.php?func=detail&aid=1373693&group_id=128687&atid=712414
Perhaps It's also possible to add ability to view all in browse of the query builder and passed this.
Thank's, Damien
I don't know, I use it with Oracle everyday...
my versions are:
DBMS == 10.1.0.3.0 || 9.2.0.1.0 && JDBC == 9.0.1.0.0 && OS == W2K
However, I'm implementing/studying an advanced config and hope to solve these issues.
("All" will appear in next release)
Thanks for your posts
please, could you try this tester and post the result?
thanks
import java.sql.*;
import java.util.*;
public class JdbcTester
{
public static void main(String args[])
{
if(args.length < 2)
{
System.out.println("arguments: <driver-class> <url> [<user> [<password>]]");
System.exit(-1);
}
String drv = args[0];
String url = args[1];
String uid = args.length > 2 ? args[2] : null;
String pwd = args.length > 3 ? args[3] : null;
DatabaseMetaData dbmd = getMetaData(drv,url,uid,pwd);
trace(dbmd);
}
static DatabaseMetaData getMetaData(String drv, String url, String uid, String pwd)
{
try
{
Class.forName(drv);
return DriverManager.getConnection(url, uid, pwd).getMetaData();
}
catch (ClassNotFoundException cnfe)
{
System.out.println(cnfe);
}
catch (SQLException sqle)
{
System.out.println(sqle);
}
return null;
}
static void trace(DatabaseMetaData dbmd)
{
if(dbmd==null) return;
traceGeneric(dbmd);
traceCatalog(dbmd);
traceSchema(dbmd);
traceTableTypes(dbmd);
traceGetTablesRequest(dbmd);
}
static void traceGeneric(DatabaseMetaData dbmd)
{
System.out.println("\n+--------------------------------------------+");
System.out.println("| Generic");
System.out.println("+--------------------------------------------+");
System.out.println(System.getProperty("os.name"));
System.out.println(System.getProperty("os.version"));
System.out.println(System.getProperty("java.version"));
try
{
System.out.println("\nProduct Name :: " + dbmd.getDatabaseProductName());
System.out.println("Product Version :: " + dbmd.getDatabaseProductVersion());
System.out.println("Driver Name :: " + dbmd.getDriverName());
System.out.println("Driver Version :: " + dbmd.getDriverVersion());
System.out.println("\nURL :: " + dbmd.getURL());
}
catch (SQLException sqle)
{
System.out.println(sqle);
}
}
static void traceCatalog(DatabaseMetaData dbmd)
{
System.out.println("\n+--------------------------------------------+");
System.out.println("| Catalog");
System.out.println("+--------------------------------------------+");
try
{
System.out.println("Term :: '" + dbmd.getCatalogTerm() + "'");
System.out.println("Max Name Length :: " + dbmd.getMaxCatalogNameLength());
System.out.println("In Table Definitions :: " + dbmd.supportsCatalogsInTableDefinitions());
System.out.println("In Data Manipulation :: " + dbmd.supportsCatalogsInDataManipulation());
traceCount(dbmd.getCatalogs());
}
catch (SQLException sqle)
{
System.out.println(sqle);
}
}
static void traceSchema(DatabaseMetaData dbmd)
{
System.out.println("\n+--------------------------------------------+");
System.out.println("| Schema");
System.out.println("+--------------------------------------------+");
try
{
System.out.println("Term :: '" + dbmd.getSchemaTerm() + "'");
System.out.println("Max Name Length :: " + dbmd.getMaxSchemaNameLength());
System.out.println("In Data Manipulation :: " + dbmd.supportsSchemasInDataManipulation());
System.out.println("In Table Definitions :: " + dbmd.supportsSchemasInTableDefinitions());
traceCount(dbmd.getSchemas());
}
catch (SQLException sqle)
{
System.out.println(sqle);
}
}
static void traceTableTypes(DatabaseMetaData dbmd)
{
System.out.println("\n+--------------------------------------------+");
System.out.println("| Table Types");
System.out.println("+--------------------------------------------+");
try
{
ResultSet rs = dbmd.getTableTypes();
for(int i=1; rs.next(); i++)
System.out.println(i + ") '" + rs.getString(1) + "'");
rs.close();
}
catch (SQLException sqle)
{
System.out.println(sqle);
}
}
static void traceGetTablesRequest(DatabaseMetaData dbmd)
{
System.out.println("\n+--------------------------------------------+");
System.out.println("| Check GetTables Request");
System.out.println("+--------------------------------------------+");
String c = null;
try
{
c = dbmd.getConnection().getCatalog();
}
catch (SQLException sqle)
{
System.out.println(sqle);
}
traceGetTablesRequest(dbmd,c,null,"TABLE");
traceGetTablesRequest(dbmd,c,"%","TABLE");
traceGetTablesRequest(dbmd,c,"TABLE");
if(c!=null)
{
traceGetTablesRequest(dbmd,null,null,"TABLE");
traceGetTablesRequest(dbmd,null,"%","TABLE");
traceGetTablesRequest(dbmd,null,"TABLE");
}
}
static void traceGetTablesRequest(DatabaseMetaData dbmd,String c,String t)
{
try
{
Vector schemas = new Vector();
ResultSet rs = dbmd.getSchemas();
while(rs.next()) schemas.addElement(rs.getString(1));
rs.close();
for(int i=0; i<schemas.size(); i++)
traceGetTablesRequest(dbmd,c,schemas.elementAt(i).toString(),t);
}
catch (SQLException sqle)
{
System.out.println(sqle);
}
}
static void traceGetTablesRequest(DatabaseMetaData dbmd,String c,String s,String t)
{
System.out.println("\ntable type = " + t);
System.out.println("catalog is " + (c==null?"null":"not null"));
System.out.println("schema is " + (s==null?"null": (s=="%"?"all":"not null")));
try
{
ResultSet rs = dbmd.getTables(c,s,"%", (t==null?null:new String[]{t}) );
traceCount(rs);
}
catch (SQLException sqle)
{
System.out.println(sqle);
}
}
static void traceCount(ResultSet rs) throws SQLException
{
int i=0;
while(rs.next()) i++;
rs.close();
System.out.println("found (" + i + ")");
}
}
Hi,
I think this is result of this query :
select 'TABLE' as table_type from dual
union select 'VIEW' as table_type from dual
union select 'SYNONYM' as table_type from dual;
On my database i found :
SYNONYM ;
TABLE ;
VIEW ;
this string is put in tableTypes and when this is used as :
SELECT NULL AS table_cat,
o.owner AS table_schem,
o.object_name AS table_name,
o.object_type AS table_type,
NULL AS remarks
FROM all_objects o
WHERE o.owner LIKE ? ESCAPE '/'
AND o.object_name LIKE ? ESCAPE '/'
AND o.object_type IN ('xxx', 'VIEW ')
ORDER BY table_type, table_schem, table_name
That dont go.
Bye
Sorry, but my precedent message is truncated.
the table_type are on 32 character as (_=space)
"TABLE___________________________"
Bye
I have tested this query on my db and it works...(note that in your prev post there is a space in 'VIEW ')
SELECT NULL AS table_cat,
o.owner AS table_schem,
o.object_name AS table_name,
o.object_type AS table_type,
NULL AS remarks
FROM all_objects o
WHERE o.object_type IN ('VIEW','TABLE')
ORDER BY table_type, table_schem, table_name;
Thank you very much!!!
This bug is now fixed!!!
http://sourceforge.net/tracker/index.php?func=detail&aid=1373693&group_id=128687&atid=712414
Hope also your...
Of course, with the test-version that is OK.
Best regards.
Damien