Sorry to jump in late here, my mail feed is acting up today. I see this response to a response but I haven't seen either of the original postings yet :-(.
Adam Frielink wrote: > > > From: Simon Oliver [mailto:[EMAIL PROTECTED]] > > You are correct, but, the docs say that if you do not use the optional flag, > a 'r' mode (read-only) will be used by default. > > When I do specify the flag (both as a literal and a variable), I get a > 'strict' error... Specifying the "r" flag is only needed or supported with AnyData used alone, never with DBD::AnyData. In the DBD, the file perms are taken from the SQL (e.g. SELECT will always be 'r' and UPDATE will always be 'u' and the user never needs to worry about it.) > $dbh->func( 'cars', 'CSV', 'cars.csv', 'ad_catalog'); > > There are no flags being used in the $dbh->func(), so I wonder, what am I > missing? You aren't missing anything, no permission flags are called for and other flags are optional. > "DBD::AnyData::db prepare failed: Parse error near () FROM SHEPC at > C:/Perl/site/lib/DBD/AnyData.pm line 126." > use strict; > use DBI; # Version 1.14 > use DBD::AnyData; # Version 0.05 You don't need to explicitly "use" DBD::AnyData, it and it's prerequisite SQL::Statement will be called automatically by DBI. > $sthcnt = $db->prepare('SELECT COUNT() FROM SHEPC') Here's the problem: there needs to be either an asterisk or a column name inside the parens after COUNT. (That's a SQL standard rule AFAIK). But I'm also noticing a bug in COUNT (*), fixed now in the development version. I can send it to you or you can wait for a release in a few days. Or you can do "SELECT COUNT ($col) .." for a column that exists in every row and get the same result. -- Jeff
