# # Dump out the Data Types used by a System # Source the script at the end... # proc print_schema {driver connect user pass schema_name} { set tablesfilter "%" java::call java.sql.DriverManager registerDriver [java::new $driver] set conn [java::call java.sql.DriverManager getConnection "$connect" "$user" "$pass"] set m [$conn getMetaData] set rss [$m getSchemas] set rsms [$rss getMetaData] set meta_schema [$rsms getColumnName 1] #while {[$rss next] != 0} { #set schema_name [$rss getString $meta_schema] set rs [$m getTables "" "$schema_name" "$tablesfilter" [java::new {java.lang.String[]} 1 {"TABLE"}]] set rsmd [$rs getMetaData] set meta_table [$rsmd getColumnName 3] set meta_tab_type [$rsmd getColumnName 4] while {[$rs next] != 0} { set table_name [$rs getString $meta_table] if {[string first "DR$" $table_name] != -1} { continue } set table_type [$rs getString $meta_tab_type] # Columns set colrs [$m getColumns "" "%" $table_name "%"] set crsmd [$colrs getMetaData] set meta_col_name [$crsmd getColumnName 4] set meta_col_type [$crsmd getColumnName 5] set meta_col_stype [$crsmd getColumnName 6] set meta_col_length [$crsmd getColumnName 7] set meta_col_scale [$crsmd getColumnName 9] set meta_col_null [$crsmd getColumnName 11] while {[$colrs next] != 0} { set column_name [$colrs getString $meta_col_name] set column_stype [$colrs getString $meta_col_stype] if {$column_stype == "ROWID"} { continue } set column_length [$colrs getString $meta_col_length] set column_scale [$colrs getString $meta_col_scale] set column_null [$colrs getString $meta_col_null] puts "DataType : $column_stype Column : $column_name Table : $table_name" } } #} $conn close } # # # CHANGE this below to your JDBC driver, your connection string and your username and password # set driver "com.mysql.jdbc.Driver" set connect "jdbc:mysql://localhost/employees?capitalizeTypeNames=TRUE" set user "DEMO" set pass "oracle" set schema_name "employees" # # Now save and source this file from OMBPlus. # print_schema $driver $connect $user $pass $schema_name