> Fra: Mitch Helle-Morrissey [mailto:[EMAIL PROTECTED]]
>
> I couldn't find anything in the archive that answers this question:
>
> Is there a way to get the server name from a database handle
> without parsing
> the $dbh->{Name} attribute? I'd like to keep this code
> database-independent, and since the format of the DSN can
> vary from one db
> to the next, I'd like to avoid parsing the Name attribute.
> Am I missing
> something simple here?
>
No. You are not missing something simple here. There is
nothing simple about the server name part os the DSN (if there
even *is* a server name part of the DSN). The format of the DSN
varies wildly from DBD to DBD (and sometimes even within a
DBD). You cannot find the server name in a simple way.
Eq. DBD::Ingres encodes the DSN as dbi:Ingres:netu::dbname
Where netu:: is an optional Netu node name. The netu node name
maps to a server name through the Ingres/Net layer. There is
no weay of discovering the server name from the Netu node name.
--
Henrik Tougaard, Copenhagen, Denmark
"The first rule of Perl Club is, we don't talk about Perl Club"
- Dave Cross at YAPC::Europe 2.0.01