fix: 获取oracle数据库的表

This commit is contained in:
taojinlong 2022-03-02 11:00:32 +08:00
parent 2cf50fd484
commit 502806161c

View File

@ -624,7 +624,7 @@ public class JdbcProvider extends DatasourceProvider {
if (StringUtils.isEmpty(oracleConfiguration.getSchema())) {
throw new Exception(Translator.get("i18n_schema_is_empty"));
}
return "select table_name, owner, comments from all_tab_comments where owner='" + oracleConfiguration.getSchema() + "' AND table_type = 'TABLE'";
return "select table_name, owner, comments from all_tab_comments where owner='OWNER' AND table_type = 'TABLE' AND table_name in (select table_name from all_tables where owner='OWNER')".replaceAll("OWNER", oracleConfiguration.getSchema());
case pg:
PgConfiguration pgConfiguration = new Gson().fromJson(datasourceRequest.getDatasource().getConfiguration(), PgConfiguration.class);
if (StringUtils.isEmpty(pgConfiguration.getSchema())) {