padawan_linuxero has asked for the wisdom of the Perl Monks concerning the following question:
Hello!!!!
I have a question I am trying to obtain from a DBF table all the data,
before working with DBF I use to work with MySql and it
always work the program I have, I use something like this
to obtain the file SELECT * INTO OUTFILE 'myfile' FIELDS TERMINATED BY ','
But now using a DBF table did not work
Can someone point me in the right direction???
Thanks
this is the code so far:
and this is the error message
I have a question I am trying to obtain from a DBF table all the data,
before working with DBF I use to work with MySql and it
always work the program I have, I use something like this
to obtain the file SELECT * INTO OUTFILE 'myfile' FIELDS TERMINATED BY ','
But now using a DBF table did not work
Can someone point me in the right direction???
Thanks
this is the code so far:
#!/usr/bin/perl -w use DBI; my $dbh = DBI->connect("DBI:XBase:/Proyecto") or die $DBI::errstr; my $sth = $dbh->prepare("SELECT * INTO OUTFILE 'mydata.csv' FIELDS + TERMINATED BY ',' FROM reg501") or die $dbh->errstr(); $sth->execute() or die $sth->errstr(); while ((my @row) = $sth->fetchrow_array()) { $counter++; print "Reg:$counter\t@row\n"; }
and this is the error message
DBD::XBase::db prepare failed: From specification expected near ` INTO + OUTFILE 'mydata.csv' FIELDS TERMIN...' at ConexionMyDbf2.pl line 7. From specification expected near ` INTO OUTFILE 'mydata.csv' FIELDS TE +RMIN...' at ConexionMyDbf2.pl line 7.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: One Question about DBF
by moritz (Cardinal) on Oct 18, 2007 at 15:46 UTC | |
Re: One Question about DBF
by jZed (Prior) on Oct 18, 2007 at 17:22 UTC | |
by padawan_linuxero (Scribe) on Oct 18, 2007 at 18:43 UTC | |
by jZed (Prior) on Oct 18, 2007 at 18:48 UTC | |
by padawan_linuxero (Scribe) on Oct 18, 2007 at 19:02 UTC | |
by jZed (Prior) on Oct 18, 2007 at 19:04 UTC | |
| |
by padawan_linuxero (Scribe) on Oct 18, 2007 at 22:07 UTC | |
Re: One Question about DBF
by sunadmn (Curate) on Oct 18, 2007 at 15:52 UTC | |
Re: One Question about DBF
by thezip (Vicar) on Oct 18, 2007 at 17:29 UTC |
Back to
Seekers of Perl Wisdom