Attached is a possible implementation for DBD::Oracle. Only a few information types are supported, but it's a beginning. I think, all currently supported information types are stable across most Oracle releases. Other types may depend on a specific version, thus SQL_DBMS_VERSION is a top entry in the TODO list. I guess OCIServerVersion can help in obtaining the version number, however it returns the complete banner. I hope I find a reliable way to parse that string. Suggestions welcome!
Steffen
*** DBD-Oracle-1.12.orig/Oracle.pm Fri Aug 31 18:27:18 2001 --- Oracle.pm Sun Dec 16 18:03:01 2001 *************** *** 313,318 **** --- 313,357 ---- } + sub get_info { + my($dbh, $info_type) = @_; + # XXX Caching + my %gi = ( + SQL_CATALOG_LOCATION => 2 + , SQL_CATALOG_NAME => 'N' + , SQL_CATALOG_NAME_SEPARATOR => '@' + , SQL_CATALOG_TERM => 'Database Link' + , SQL_DATABASE_NAME => undef + , SQL_DATA_SOURCE_NAME => 'dbi:Oracle:' . $dbh->{Name} + , SQL_DBMS_NAME => 'Oracle' + # , SQL_DBMS_VERSION => # XXX OCIServerVersion + , SQL_DRIVER_NAME => __FILE__ + , SQL_DRIVER_VER => $DBD::Oracle::VERSION # XXX ##.##.#### + , SQL_IDENTIFIER_QUOTE_CHAR => '"' + , SQL_MAX_CATALOG_NAME_LEN => 0 + , SQL_MAX_COLUMN_NAME_LEN => 30 + , SQL_MAX_IDENTIFIER_LEN => 30 + , SQL_MAX_OWNER_NAME_LEN => 30 + , SQL_MAX_QUALIFIER_NAME_LEN => 0 + , SQL_MAX_SCHEMA_NAME_LEN => 30 + , SQL_MAX_TABLE_NAME_LEN => 30 + , SQL_MAX_USER_NAME_LEN => 30 + , SQL_OWNER_TERM => 'Owner' + , SQL_PROCEDURE_TERM => 'Procedure' + , SQL_QUALIFIER_LOCATION => 2 + , SQL_QUALIFIER_NAME_SEPARATOR => '@' + , SQL_QUALIFIER_TERM => 'Database Link' + , SQL_SCHEMA_TERM => 'Owner' + , SQL_SEARCH_PATTERN_ESCAPE => '\\' + , SQL_SERVER_NAME => $dbh->{Name} + , SQL_SPECIAL_CHARACTERS => '$#' + , SQL_TABLE_TERM => 'Table' + , SQL_USER_NAME => $dbh->{CURRENT_USER} ||'' # XXX OPS$ + ); + return $gi{$info_type}; + } + + sub table_info { my($dbh, $attr) = @_; # XXX add knowledge of temp tables, etc