in reply to One Question about DBF
#!/usr/bin/perl use warnings; use strict; use DBI; my $dbhX = DBI->connect('dbi:XBase(RaiseError=1):'); my $dbhC = DBI->connect('dbi:CSV(RaiseError=1):'); my $select = $dbhX->prepare("SELECT * FROM inTable"); $select->execute(); $dbhC->do("CREATE TABLE outTable AS IMPORT(?)",{},$select); __END__
Update : replaced my bad code with a working example.
my $dbhX = DBI->connect ( Xbase connection info); my $dbhA = DBI->connect( 'dbi:AnyData:' ); $dbhA->ad_catalog('outfile','CSV',$output_filename); my $sth = $dbhX->prepare( Select SQL ); $sth->execute(); $dbhA->do("CREATE TABLE outfile AS SELECT * FROM ?",{}, $sth);
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: One Question about DBF
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 19:22 UTC | |
| |
Re^2: One Question about DBF
by padawan_linuxero (Scribe) on Oct 18, 2007 at 22:07 UTC |