Example of using DBD:ODBC to connect to Oracle with no DSN
- From: dobomode@xxxxxxxxx
- Date: 26 Apr 2005 07:54:26 -0700
Hello there,
Currently I am using this to connect to Oracle via DBD::ODBC
$dbh = DBI->connect("dbi:ODBC:sg.corp.com", $conf{'user'},
$conf{'password'},
{PrintWarn => 0, AutoCommit => 0,
PrintError => 0,RaiseError => 1})
|| die "Cannot connect to Oracle database: $DBI::errstr.\n";
Works fine and smoothly.
Now, since I am developing this app for people at my company to use, I
don't want to have everybody set up a DSN entry (sg.corp.com in the
example above) in their control panel. Instead, I'd like to use the
dbi:ODBC:DRIVER syntax to connect to Oracle directly bypassing the DNS
entries. I've searched like crazy but could not find much on the topic.
Anybody?
Thanks!
P.S. If you're curious why DBD:ODBC vs DBD:Oracle, it's the fact that
the latter has some issues with dealing with BLOB (I've spent a full
day troubleshooting this to no success, tried quickly ODBC and bingo -
magic!)
.
- Follow-Ups:
- Prev by Date: Re: Suggested Patch for DBD::mysql
- Next by Date: load_dbnames() function - DBD::Oracle
- Previous by thread: DBD::Oracle Installation problem
- Next by thread: Re: Example of using DBD:ODBC to connect to Oracle with no DSN
- Index(es):
Relevant Pages
|
|