We're trying to override the DBI->connect() method for DBD::DB2 to support longer database names.
Some background: - DB2 supports only 8-character database names and aliases - We plan to have hundreds to thousands of them, so we end up with non-intelligeble names. - We have a mapping file that maps logical names (to us, which means something like NYTD_YOUR_APPLICATION or LNQD_OTHER_APPLICATION) to one of the 8-character names that DB2 limits us to.
The first approach we came up with was to define a "Morgan Stanley DB2" driver, as that would allow us to avoid changing DBD::DB2.
Obviously, I'm missing some clues on how to actually do this kind of thing. Any suggestions?
If you can't figure this out, then a simple alternate solution is to just make your module wrap DBI instead of DBD::DB2?
Or just have a function in your caller program that is used together with connect() that does the name conversion. Eg, "$dbh = DBI->connect( my_longer_to_shorter() )".
(Of course, if you follow either of those alternate approaches, then further discussion on the details is no longer on topic for dbi-dev, and you'd have to take them to dbi-users.)
-- Darren Duncan