I want to use a given csv file as an Database. My problem ist the
content, if I delete any "." (dot) or "-" everythings work as i would
estimate. But in my case only:

DBD::CSV::st fetchrow_array failed: Attempt to fetch row from a Non-
SELECT statement [for Statement "SELECT * FROM info where
IP=192.168.1.44"] at X:\Scripting\Perl\DBD-CSV\test1\test.pl line 13.

appears.
How could I  solve this?

###content of my test.pl###
use DBI;
# $dbh=Database handle
# $sth=Statement handle
#
   $dbh = DBI->connect("DBI:CSV:f_dir=X:\\Scripting\\Perl\\DBD-CSV\
\test1")
       or die "Cannot connect: " . $DBI::errstr;

$dbh = DBI->connect(qq{DBI:CSV:csv_sep_char=\\;});
   $dbh->{'csv_tables'}->{'info'} = { 'file' => 'test_csv_tabelle'};

   $sth = $dbh->prepare("SELECT * FROM info where IP=192.168.1.44");
   $sth->execute($baz);
   while ( @row = $sth->fetchrow_array ) {
       print "@row\n";
   }

   $sth->finish();
   $dbh->disconnect();
###END###
###content of my test_csv_tabelle###
Date;Time;PC_Name;SN;MAC;IP;User;Switch;SW_IP;Port
1;2;3;4;5;6;7;8;9;10
20070104;12:21;PC013;KXXXXXP;
000000000007;192.168.1.44;CK;S130;192.168.1.1;Fa0/17;
###END###

Reply via email to