XBase : can't find .dbt file
Posted by: John Cowan
Date: June 18, 2009 09:09AM

Greetings,
The title is correct; can't find a .dbt file (note the t in .dbt).

I'm moving a Perl script from my windows xp machine to a linux server. When finished, a cronjob to run this program.

The program runs fine on the windows machine, but I'm having what seems to be an XBase bug on the linux machine.

I run a command on the command line to copy a bunch of FoxPro tables from one server (a foxpro production db) to another server/directory to be worked on. This works and copies all the table files (.dbf, .cdx, and .fpt). Note: not all the .fpt files get copied.

Then I run a Perl script which loops through an array of the table names, creates a tab-delimited txt file to be used as a datafile for a sql-loader command that uploads the data into Oracle tables. Piece of cake!

Problem:
I have about 50 tables. This all works fine on about 44 tables. On the others, I'm getting an XBase error about '... can't find file tablename.dbt' note the 't' in the extension.

Would anyone have an idea on what is causing this error? I'm baffled.

Code - main parts related...

use DBI;
use XBase;

#connection to foxpro
eval { $foxDbh = DBI->connect("dbi:XBase: // blah blah blah } # partial syntax

# Tables that wont run in command line: '
@CsoTableNames = ('cm', 'jb','mp', 'nt', 'rp', 'su');

foreach my $table (@CsoTableNames) {
$sql = "select * from $table";
eval{
$foxSth = $foxDbh->prepare($sql);
$foxSth->execute;
};
if($@){
$errorString = " Problem Selecting from FoxPro $table table.".$@;
print "Error on table $table : ".$errorString."\n";
SendEmail($errorString);
}
}

Error:
DBD::XBase::st execute failed: Table cm not found: Error opening file /home/path/to/tables/cm.dbt: No such file or directory

Error on table cm : Problem Selecting from FoxPro cm table.DBD::XBase::st execute failed: Table cm not found: Error opening file /home/path/to/tables/cm.dbt: No such file or directory

I've checked and tested the tables in the directory they are copied to. I can open them in FoxPro and the data is good. Again, this only happens on six of the fifty tables. Strange!

Any help or ideas would be GREATLY appreciated.

Options: ReplyQuote


Subject
Views
Written By
Posted
XBase : can't find .dbt file
11226
June 18, 2009 09:09AM
4723
June 19, 2009 11:20AM
5092
July 15, 2009 11:57PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.