in reply to Re^2: One Question about DBF
in thread One Question about DBF

Oh, sorry, yeah, after the $dbhA line put this:
$dbhA->ad_catalog('etstx','CSV','etstx.csv');
The first param is the table name to use in your SQL, the second the format of the file the table will be stored in, the third the path/filename of the file.

update : added the missing ad_

Replies are listed 'Best First'.
Re^4: One Question about DBF
by padawan_linuxero (Scribe) on Oct 18, 2007 at 19:02 UTC
    Hi jZed!
    I added the line as you told me but it gave me these error
    Can't locate object method "catalog" via package "DBI::db" at testdbf.pl line 5.
    This is the code
    use DBI; my $dbhX = DBI->connect("DBI:XBase:/proyecto"); my $dbhA = DBI->connect( 'dbi:AnyData:' ); $dbhA->catalog('etstx','CSV','etstx.csv'); my $sth = $dbhX->prepare("SELECT * FROM reg501"); $sth->execute(); $dbhA->do("CREATE TABLE etstx AS SELECT * FROM ?",{}, $sth);
      Sorry again, not enough coffee this morning - should be $dbh->ad_catalog().
        Hi jZed!!!
        this is the code :
        use DBI; my $dbhX = DBI->connect("DBI:XBase:/proyecto"); my $dbhA = DBI->connect( 'dbi:AnyData:' ); $dbhA->ad_catalog('etstx','CSV','etstx.csv'); my $sth = $dbhX->prepare("SELECT * FROM reg501"); $sth->execute(); $dbhA->do("CREATE TABLE etstx AS SELECT * FROM ?",{}, $sth);
        So my cuestion is where do I put the $dbh->ad_catalog()