DBI::Oracle is not supported correctly
slatibart opened this issue · 6 comments
For example you can not set the sid string for the dbi connection.
$dbh = DBI->connect("dbi:Oracle:host=$host;sid=$sid", $user, $passwd);
And I'm not sure if that is related to this plugin.
I am setting ORACLE_HOME in the dancer script, so that DBI finds out about the tnsnames.ora
and I don't need to set host and so on but somehow this ENV variable doesn't get used by DBI::Oracle.
It is working for other non dancer scripts with perl.
regards
Andreas
Looks like allowing the sid
string (I don't know what that is, offhand) should be easy enough - it'll be this bit of code which assembles the DSN which would need tweaking:
for (qw(database dbname host port)) {
if (exists $settings->{$_}) {
push @extra_args, $_ . "=" . $settings->{$_};
}
}
$dsn .= ':' . join(';', @extra_args) if @extra_args;
In the meantime, though, you can supply a pre-crafted DSN instead which should work?
Hi David,
sid is a kind of db_identifiert alias for the hostname and port
http://search.cpan.org/~pythian/DBD-Oracle-1.52/lib/DBD/Oracle.pm
$dbh = DBI->connect("dbi:Oracle:host=$host;sid=$sid", $user, $passwd);
Probably a keyword like ORACLE_SID would work.
I've got my connection running, with some workaround.
If that is an easy fix would love to see it done.
regards
Andreas
On 10/29/12 21:19, David Precious wrote:
Looks like allowing the |sid| string (I don't know what that is,
offhand) should be easy enough - it'll be this bit of code which
assembles the DSN which would need tweaking:for (qw(database dbname host port)) { if (exists $settings->{$_}) { push @extra_args, $_ . "=" . $settings->{$_}; } } $dsn .= ':' . join(';', @extra_args) if @extra_args;
In the meantime, though, you can supply a pre-crafted DSN instead
which should work?—
Reply to this email directly or view it on GitHub
#36 (comment).
Hi Andreas,
I've got my connection running, with some workaround.
Would you be so kind as to share your workaround since an update to Dancer-Plugin-Database has not been released yet?
Advance Thanks,
Tiffany
Thanks for the reminder of this issue - I'll try to get a new release out shortly with the appropriate fix for you @tyupshaw