J
jl_post
Dear Perl community,
Recently I installed DBD:BM on my platform (Strawberry Perl on
Windows Vista). However, when I type "del user*" and run the
following program (that I found in "perldoc DBD:BM):
use DBI;
my $dbh = DBI->connect('dbiBM:');
$dbh->{RaiseError} = 1;
for my $sql( split /;\n+/,"
CREATE TABLE user ( user_name TEXT, phone TEXT );
INSERT INTO user VALUES ('Fred Bloggs','233-7777');
INSERT INTO user VALUES ('Sanjay Patel','777-3333');
INSERT INTO user VALUES ('Junk','xxx-xxxx');
DELETE FROM user WHERE user_name = 'Junk';
UPDATE user SET phone = '999-4444' WHERE user_name = 'Sanjay
Patel';
SELECT * FROM user
"){
my $sth = $dbh->prepare($sql);
$sth->execute;
$sth->dump_results if $sth->{NUM_OF_FIELDS};
}
$dbh->disconnect;
I see:
Execution ERROR: Table 'user' already exists..
DBD:BM::st execute failed:
Execution ERROR: Table 'user' already exists..
[for Statement "
CREATE TABLE user ( user_name TEXT, phone TEXT )"] at dbi_dbm.pl
line 14.
DBD:BM::st execute failed:
Execution ERROR: Table 'user' already exists..
[for Statement "
CREATE TABLE user ( user_name TEXT, phone TEXT )"] at dbi_dbm.pl
line 14.
and I see three new zero-length files named "user.lck", "user.pag",
and "user.dir".
I decided to rerun the script (after "del user*") with the "$dbh-
Execution ERROR: Cannot CREATE 'user.pag' because it already exists at
C:/strawb
erry/perl/site/lib/DBD/DBM.pm line 338.
DBD:BM::st execute failed: Can't call method "column" on an
undefined value at
C:/strawberry/perl/site/lib/SQL/Statement/Term.pm line 190.
[for Statement " DELETE FROM user WHERE user_name = 'Junk'"] at
dbi_dbm.pl line 14.
Execution ERROR: Column 'phone' not known in any table called from C:/
strawberry
/perl/site/lib/DBD/File.pm at 446.
Execution ERROR:
Execution ERROR: Column 'phone' not known in any table called from C:/
strawberry/perl/site/lib/DBD/File.pm at 446.
called from dbi_dbm.pl at 14.
Execution ERROR:
Execution ERROR:
Execution ERROR: Column 'phone' not known in any table called from C:/
strawberry/perl/site/lib/DBD/File.pm at 446.
called from dbi_dbm.pl at 14.
undef, undef
undef, undef
undef, undef
3 rows
This time, the "user.pag" file has 1,024 bytes in it, and when I view
it in a hex editor, I see that it ends with this text: xxx-
xxxxJunk777-3333Sanjay Patel233-7777Fred Bloggs
So it looks like the "INSERT INTO" commands worked, but the
"UPDATE" and "SELECT" commands didn't work.
(For the record, I am deleting the user* files before I run the
script.)
I tried running this script on a Linux platform, and it worked fine
(with no errors). I'm only getting this error running this script on
my Windows platform (Strawberry Perl 5.10 on Windows Vista), and so
I'm wondering if anyone else on a similar platform is seeing the same
error I'm seeing.
For anyone who wants it, here are the first two lines of "perl -v":
Copyright 1987-2007, Larry Wall
Is anyone else having trouble using DBD:BM ?
Thanks.
-- Jean-Luc
Recently I installed DBD:BM on my platform (Strawberry Perl on
Windows Vista). However, when I type "del user*" and run the
following program (that I found in "perldoc DBD:BM):
use DBI;
my $dbh = DBI->connect('dbiBM:');
$dbh->{RaiseError} = 1;
for my $sql( split /;\n+/,"
CREATE TABLE user ( user_name TEXT, phone TEXT );
INSERT INTO user VALUES ('Fred Bloggs','233-7777');
INSERT INTO user VALUES ('Sanjay Patel','777-3333');
INSERT INTO user VALUES ('Junk','xxx-xxxx');
DELETE FROM user WHERE user_name = 'Junk';
UPDATE user SET phone = '999-4444' WHERE user_name = 'Sanjay
Patel';
SELECT * FROM user
"){
my $sth = $dbh->prepare($sql);
$sth->execute;
$sth->dump_results if $sth->{NUM_OF_FIELDS};
}
$dbh->disconnect;
I see:
Execution ERROR: Table 'user' already exists..
DBD:BM::st execute failed:
Execution ERROR: Table 'user' already exists..
[for Statement "
CREATE TABLE user ( user_name TEXT, phone TEXT )"] at dbi_dbm.pl
line 14.
DBD:BM::st execute failed:
Execution ERROR: Table 'user' already exists..
[for Statement "
CREATE TABLE user ( user_name TEXT, phone TEXT )"] at dbi_dbm.pl
line 14.
and I see three new zero-length files named "user.lck", "user.pag",
and "user.dir".
I decided to rerun the script (after "del user*") with the "$dbh-
messages:{RaiseError} = 1;" line commented out, and I still get error
Execution ERROR: Cannot CREATE 'user.pag' because it already exists at
C:/strawb
erry/perl/site/lib/DBD/DBM.pm line 338.
DBD:BM::st execute failed: Can't call method "column" on an
undefined value at
C:/strawberry/perl/site/lib/SQL/Statement/Term.pm line 190.
[for Statement " DELETE FROM user WHERE user_name = 'Junk'"] at
dbi_dbm.pl line 14.
Execution ERROR: Column 'phone' not known in any table called from C:/
strawberry
/perl/site/lib/DBD/File.pm at 446.
Execution ERROR:
Execution ERROR: Column 'phone' not known in any table called from C:/
strawberry/perl/site/lib/DBD/File.pm at 446.
called from dbi_dbm.pl at 14.
Execution ERROR:
Execution ERROR:
Execution ERROR: Column 'phone' not known in any table called from C:/
strawberry/perl/site/lib/DBD/File.pm at 446.
called from dbi_dbm.pl at 14.
undef, undef
undef, undef
undef, undef
3 rows
This time, the "user.pag" file has 1,024 bytes in it, and when I view
it in a hex editor, I see that it ends with this text: xxx-
xxxxJunk777-3333Sanjay Patel233-7777Fred Bloggs
So it looks like the "INSERT INTO" commands worked, but the
"UPDATE" and "SELECT" commands didn't work.
(For the record, I am deleting the user* files before I run the
script.)
I tried running this script on a Linux platform, and it worked fine
(with no errors). I'm only getting this error running this script on
my Windows platform (Strawberry Perl 5.10 on Windows Vista), and so
I'm wondering if anyone else on a similar platform is seeing the same
error I'm seeing.
For anyone who wants it, here are the first two lines of "perl -v":
This is perl, v5.10.0 built for MSWin32-x86-multi-threadperl -v
Copyright 1987-2007, Larry Wall
Is anyone else having trouble using DBD:BM ?
Thanks.
-- Jean-Luc