On Wed 2002/12/04 21:38:12 PST, Jonathan Leffler <[EMAIL PROTECTED]> write
s:
> Stephen R. Wilcoxon wrote:
> > Is it possible to get the driver specific prefix programmatically with a 
> > database handle (or statement handle)?  For example if I do:
> > 
> > $dbh = DBI->connect('dbi:Sybase:...');
> > $sth = $dbh->execute('select 1');
> > 
> > Is there any way to get 'syb' or 'syb_' from the $dbh or $sth (since that 
> > is the driver prefix for Sybase)?
> 
> 
> Why would you need to do so?  What would you be able to do with the 
> information that you can't do without it?

I have a module that can have schema information retrieved from multiple 
$dbh's (possibly different dbms) and it would be handy (though not 
critical) to only get driver-specific information from DBI::column_info if 
the $dbh used to call column_info matched the driver used to create 
previously gathered information.  I suppose I could get this indirectly 
(check $dbh->{Driver}->{Name} against a stored value gotten from the 
original call and then just check for lowercase names (since all 
driver-specific values are supposed to be the only lower-case ones)).  The 
other obvious "solution" was to hard-code a hash of values from the DBI 
docs of all the driver names and abbreviations (which is not ideal since it 
would have to be updated every time a new DBD driver was created).


Reply via email to