Ok, I'm having a problem with DBD::CSV that I didn't have with DBD::XBase.
The problem appears to actually be coming from the SQL::Statement module.
The database is created and is uncorrupted, but the script responds with
errors (ambiguous ones at that). These are the errors (8 identical including
the hash reference address, one less than the number of entries in the text
file) and the code is below (any help would be appreciated):
<8 error messages>
Execution ERROR:
No such column 'SQL::Statement::Table=HASH(0x1d88d48).created'.
<code>
#!/usr/bin/perl -w
use DBI;
use strict;
my $DSN = "DBI:CSV:f_dir=/tmp/data/";
# my $DSN = "DBI:XBase:/tmp/data/";
my $dbh = DBI->connect("$DSN")
or die "LINE21:" . $DBI::errstr;
$dbh->do("create table users (
Created char(30),
Name char(50),
Email char(50),
Entered char(30)
)") or die "LINE28:" . $dbh->errstr();
my $sth;
$sth = $dbh->prepare( "insert into users values( ?, ?, ?, ? )" )
or die "LINE32:" . $sth->errstr();
open( IN, "./test.txt" );
while( <IN> ) {
(my $name, my $email) = split /`/;
chomp $email if defined($email);
if( defined($email) && length( $email ) ) {
my $time = time();
$sth->execute( $time, $name, $email, $time )
or die "LINE40: " . $sth->errstr();
}
}
close( IN );
$dbh->disconnect();
<text file>
Grant M`[EMAIL PROTECTED]
Fred Martin`[EMAIL PROTECTED]
Tom Manley`[EMAIL PROTECTED]
Connie Chung`[EMAIL PROTECTED]
Marge Simpson`[EMAIL PROTECTED]
Jerry Springer`[EMAIL PROTECTED]
Thomas Fillion`[EMAIL PROTECTED]
Bill Malloy`[EMAIL PROTECTED]
Jerko Wonder`[EMAIL PROTECTED]
Thanks in advance for any help,
Grant M.
[EMAIL PROTECTED]