DBD::DBM and Berkeley Problem
am 03.10.2007 08:23:19 von Christian MaierHello
Can anyone tell me whats the problem with the following code. I get an
error about 2nd tie fails?
Thank You
Chris
#!/usr/bin/perl
use DBI;
my $dbh = DBI->connect('dbi:DBM:type=BerkeleyDB;mldbm=Storable;ext=');
my $dir = "./"; #/media/sda1/home/cikic/.qtstalker/data1/data/Stocks/
Yahoo/US/";
use BerkeleyDB;
my $env = new BerkeleyDB::Env -Home => $dir; # and/or other Env flags
$dbh->{dbm_berkeley_flags} = {
'DB_CREATE' => DB_CREATE # pass in constants
, 'DB_RDONLY' => DB_RDONLY # pass in constants
, '-Cachesize' => 1000 # set a ::Hash flag
, '-Env' => $env # pass in an environment
};
print $dbh->{sql_handler} . "\n";
my $stmt = $dbh->prepare("SELECT * FROM nasdaq");
$stmt->execute();
Output is:
DBI::SQL::Nano
MLDBM error: Second level tie failed, "" at /usr/local/lib/perl/5.8.8/
DBD/DBM.pm line 390
cikic@MrZylinder:~/sources/berkeley-sql$ cat bdb_connect.pl