On Tue Nov 30 14:39:19 2010, ceverett@ceverett.com wrote:
Show quoted text> # DBD::Oracle chokes on strings assigned to Readonly scalar:
>
> use strict;
> use Readonly;
> use DBI;
>
> Readonly::Scalar my $SQL => 'select * from Foo.Bar';
>
> # and later:
>
> my $dbh = $DBI->connect( 'dbi::oracle::$DB_SRV', $DB_USR, $DB_PWD );
> my $sth = $dbh->prepare($SQL); # call to prepare blows up
Are you sure?
There are at least 3 mistakes in the code above:
1. "$DBI" => DBI
2. :: in connect string should be single colons
3. "oracle" in connect string should be "Oracle"
and once I correct all of these to something like:
use strict;
use Readonly;
use DBI;
Readonly::Scalar my $SQL => 'select * from market_type';
# and later:
my $dbh = DBI->connect( 'dbi:Oracle:xxx', 'xxx', 'xxx' );
my $sth = $dbh->prepare($SQL);
It works fine for me.
Martin
--
Martin J. Evans
Wetherby, UK