I can replicate this error on windows (Win XP 5.1; Perl 5.6.1). However, the syntax below (using place-holders) works correctly for me. I often find that inserting a NULL into the leading field of a database table causes problems when not using place-holders. Does this work for you?
Hope this helps,use DBI; use strict; my $dbh = DBI->connect("DBI:CSV:f_dir=./;"); my $param1 = undef; my $param2 = 'test'; my $sql_create = ' create table mytable( field1 text, field2 text )'; my $sql_insert = ' INSERT INTO mytable( field1, field2 ) VALUES (?,?)'; my $sth_insert = $dbh->prepare($sql_insert); $dbh->do($sql_create); $sth_insert->execute($param1, $param2); print "field1=",$dbh->selectrow_array("select field1 from mytable");
Update:
DBD::DSV 0.2002
DBI 1.30
In reply to Re: DBD::CSV empty fields problem on RedHat / Perl 5.8.
by Itatsumaki
in thread DBD::CSV empty fields problem on RedHat / Perl 5.8.
by benn
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |