Subject: | Oracle support in get_tables (solution included) |
3 problems in get_tables for Oracle :
1) $self->get_dbh->tables() returns a lot of information (probably
system tables & such) which later on make GraphViz::DBI die when it
tries to do a SELECT on some of them.
I've solved that problem using this :
$self->get_dbh->tables(undef, $schema, undef, "'TABLE','VIEW'")
$schema must be defined previously (no good idea on how to do that
properly except hardcoding in my case) to be the DB schema we are in.
Doing so get me the correct list of tables.
Which was also basically the bugreport RT#14290
2) Almost the correct list of tables in fact, since there seems to be
in Oracle some auto/system tables called BIN$ + a long list of charactesr.
So I add to put a grep to filter these out
3) tables() returns table names in the form: "SCHEMA"."TABLE"
So both the 4 " and everything before the . should be removed to be
later on correctly processed by GraphViz::DBI.
So I've added in the map {} :
s/"//g;
(the other s/// dealing with MySQL does the same thing here with Oracle,
so it is good).
There are probably better solutions for each case, but with these fixes
I can successfully use your module with an Oracle SGBDR.
I hope that helps.