return"select column_name AS COLNAME, ordinal_position AS COLPOSITION, column_default AS DATADEFAULT, is_nullable AS NULLABLE, data_type AS DATATYPE, "+
"character_maximum_length AS DATALENGTH, numeric_precision AS DATAPRECISION, numeric_scale AS DATASCALE, column_key AS COLKEY, column_comment AS COLCOMMENT "+
"from information_schema.columns where table_schema = '"+dbName+"' and table_name = '"+tableName+"' ";
}
@Override
publicStringtables(StringdbName){
// return "select table_name name, table_comment comment from information_schema.tables where table_schema = '" + dbName + "' and table_type = 'BASE TABLE' ";
return"SELECT table_name name FROM information_schema.tables WHERE table_schema = '"+dbName+"' AND table_type = 'BASE TABLE' ";
return"SELECT table_name AS TABLENAME, table_comment AS TABLECOMMENT FROM information_schema.tables where table_schema = '"+dbName+"' ";
return"select * from user_tab_columns where table_name = '"+tableName+"' ";
return"select columns.column_name AS colName, columns.data_type AS DATATYPE, columns.data_length AS DATALENGTH, columns.data_precision AS DATAPRECISION, "+
"columns.data_scale AS DATASCALE, columns.nullable AS NULLABLE, columns.column_id AS COLPOSITION, columns.data_default AS DATADEFAULT, comments.comments AS COLCOMMENT "+
"from sys.dba_tab_columns columns LEFT JOIN sys.dba_col_comments comments ON columns.owner = comments.owner AND columns.table_name = comments.table_name AND columns.column_name = comments.column_name "+
"where columns.owner = UPPER('"+dbName+"') and columns.table_name = UPPER('"+tableName+"')";
}
@Override
publicStringtables(StringdbName){
return"SELECT table_name name FROM user_tables";
return"select tables.table_name AS TABLENAME, comments.comments AS TABLECOMMENT from sys.dba_tables tables "+
"LEFT JOIN sys.dba_tab_comments comments ON tables.owner = comments.owner AND tables.table_name = comments.table_name "+
"where tables.owner = UPPER('"+dbName+"') ";
}
@Override
...
...
@@ -33,12 +39,29 @@ public class OracleDialect extends AbstractDbDialect {
return"select columns.name AS colName, columns.column_id AS COLPOSITION, columns.max_length AS DATALENGTH, columns.precision AS DATAPRECISION, columns.scale AS DATASCALE, "+
"columns.is_nullable AS NULLABLE, types.name AS DATATYPE, properties.value AS COLCOMMENT, e.text AS DATADEFAULT "+
"from sys.columns columns LEFT JOIN sys.types types ON columns.system_type_id = types.system_type_id "+
"LEFT JOIN syscomments e ON columns.default_object_id= e.id "+
"LEFT JOIN sys.extended_properties properties ON properties.major_id = columns.object_id AND properties.minor_id = columns.column_id "+