UPDATE: appologies, I thought the post I was responding to was the first post and only just realised it was in the middle of the thread.
You've given us so little context so I'll have to assume you already know you want to use an ODBC.
DBI provides a single interface to multiple DBDs (DataBase Drivers). Most DBDs only support one database backend (e.g., DBD::Oracle only talks to Oracle, DBD::Pg only talks to postgres) and are usually built against a database supplied client library.
DBD::ODBC is an interface between DBI and the ODBC API so not just one database as many databases have ODBC Drivers. DBD::ODBC needs to link with an ODBC Driver Manager (unixODBC or the MS ODBC Driver Manager). When you use an ODBC Driver in perl:
- your perl code tells DBI which perl DBD to load - the 'dbi:XXX' in the connect string. If you use 'dbi:ODBC', DBI loads the perl DBD::ODBC driver.
- you pass a connection string through DBI which ends up in DBD::ODBC e.g., 'dbi:ODBC:DSN=mydsn'. DBD::ODBC passes this (DSN=mydsn) to the ODBC Driver manager (unixODBC) which uses 'DSN=mydsn' to work out which ODBC Driver to load.
So, to use DBD::ODBC you need to install a) unixODBC and b) an ODBC driver. The unixODBC packages you need are often called 'unixodbc' and unixodbc-dev. Then you'll need to get hold of the ODBC driver for your database, install that and tell unixODBC about it (usually by settings in an /etc/odbcinst.ini file.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.