I have a TAB delimited flat file containing Sales History records

This is my first attempt at the DBD:AnyData (got a similar error from
DBD::CSV also) module and I consistently get this error from the following
code...

DBD::AnyData::db prepare failed: Parse error near () FROM SHEPC at
C:/Perl/site/lib/DBD/AnyData.pm line 126.
Unable to prepare SELECT COUNT: Parse error near () FROM SHEPC at
C:/Perl/site/lib/DBD/AnyData.pm line 126.


__BEGIN__
use strict;
use DBI;                    # Version 1.14
use DBD::AnyData;           # Version 0.05

my ($db, $sth, $sthcnt, @values, $count);
$db = DBI->connect('dbi:AnyData:(RaiseError=>1')
           || print "$DBI::errstr\n";
$db->func('SHEPC', 'Tab', 'C:/documents and
settings/user/desktop/dataformats/SHEPC', 'ad_catalog');
$sth = $db->prepare('SELECT * FROM SHEPC') || die "Unable to prepare SELECT
*: $DBI::errstr\n";
$sthcnt = $db->prepare('SELECT COUNT() FROM SHEPC') || die "Unable to
prepare SELECT COUNT: $DBI::errstr\n";
$sthcnt->execute() || die "Unable to Execute Count: $DBI::errstr\n";;
$count = $sthcnt->fetchrow();
print "There are $count records in the table\n\nHere they are!!!";
$sth->execute() || die "Unable to execute select: $DBI::errstr\n";
while (@values=$sth->fetchrow_array()) {
        print @values;
        sleep 1;
}


__END__

Is this an easily correctable problem, something simple?


_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users

Reply via email to