TCLUG Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [TCLUG:13524] perl DBI question....
This is true, it is meant to be DB independant as much as possible. The
portion after the DBI:$driver in the data source argument is there to
allow parameters to be passed by DBI into the DB that is being connected
to. To quote the perldoc for DBI, though:
Examples of $data_source values:
dbi:DriverName:database_name
dbi:DriverName:database_name@hostname:port
dbi:DriverName:database=database_name;host=hostname;port=port
There is no standard for the text following the driver
name. Each driver is free to use whatever syntax it
wants. The only requirement the DBI makes is that all
the information is supplied in a single string. You
must consult the documentation for the drivers you are
using for a description of the syntax they require.
(Where a driver author needs to define a syntax for
the data_source it is recommended that they follow the
ODBC style, the last example above.)
Thus, you must still at this point know what you are connecting you when
creating you data source.
-Chris
On Thu, 10 Feb 2000, Schlough, Mark wrote:
<snip>
> I didn't think that DBI was specific to any database, I thought
> that's what DBD:Whatever was for. That's what's confusing. What's
> pertinent to DBI and what's for DBD:Whatever...
<more snip>
> > DBI:$driver:database=$database;host=$hostname;port=$port
<yet more snip>