Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Btrieve Code

by Poetic Justice (Monk)
on Aug 30, 2000 at 19:46 UTC ( [id://30314]=perlquestion: print w/replies, xml ) Need Help??

Poetic Justice has asked for the wisdom of the Perl Monks concerning the following question:

Has anyone coded a perl module for btrieve? My employer just bought another company. They have data we need to import into our current database (customers, inventory). I can use their utility to perform the operation 1 file at a time for 150+ files. I would like to write a mapping program in Perl that would take tableX rowX columnX data and dump it into tableY rowY columnY. Anyone ever done this with btrieve and perl?

Replies are listed 'Best First'.
Re: Btrieve Code
by lhoward (Vicar) on Aug 30, 2000 at 19:49 UTC
      I've been looking for the same thing, and the BTRIEVE module in CPAN only supports "SAVE" files, and specifically does not support the "other 12 documented formats"... apparently including ".BTR" files (which is what I need a parser for). My fix is to install Pervasive on my computer and extract the database into a CSV and have Perl parse and inject that into our target db. That, or see if there's a Pervasive JDBC driver and do it in Java. Or maybe this is an excuse to learn Python. Or...
      Yea, got it. I've looked at it before. I still may be able to use it in this app. What I'm lookin' to do is pull the data from a Win32 system DSN into another Win32 system DSN (use appropriate SQL here). I'm trying to do something without using DBI, but there may be no way around it. "Licenses.....We don't neeed no steeeekin' licenses....
Re: Btrieve Code
by gnat (Beadle) on Aug 30, 2000 at 21:49 UTC
    If you want to do Windows database stuff without using DBI, try using ODBC. Win32::ODBC is in the libwin32 bundle, and probably comes standard with ActivePerl.

    Nat

Re: Btrieve Code
by guha (Priest) on Sep 09, 2003 at 21:15 UTC

    Unless the the purchased company has a Pervasive DB engine you can use, there is the option of downloading a 30-day evaluation copy of the workgroup engine directly from the source.

    Then you can use DBI and DBD::ODBC to access the database, works pretty well IMHO. You can open connections simultanously to the purchased database and your current database, hence moving data in one step.

    The only cinch is that you need the database description files (.DDF) to be able to use the SQL interface. Otherwise you will have to resort to dumping table data to disk using the BUTIL utility, and then use perl and substr | unpack to parse the asciifiles, yuck.

    So, check if the purchased company used the MKDE interface(bad for you) or the SRE (good for you) before anything else.

    Update:
    Changed CPAN links.
Re: Btrieve Code
by Poetic Justice (Monk) on Aug 31, 2000 at 06:02 UTC
    Thanks for the replies to my post. You have made me really begin to think this thing out a little more. BTW I went to "The Source Forge and submitted a proposal for a set of Btrieve Tools made with Perl. Maybe some folks will want to join me in the quest. Poetic Justice "Licenses.....We don't neeed no steeeekin' licenses....

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://30314]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (8)
As of 2024-04-16 11:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found