Accessing Pervasive.SQL With Perl

Page Last Modified: 11/09/17

Home Links ODBC (DBI) Contact

These pages contain some examples on how I access the Pervasive.SQL database management system using Perl. This is a task I have often had to do over the last few years during my main employment (supporting a legacy database application), either running the Perl code via the usual 'perl ..' interpreter command or building a stand-alone, self-extracting Windows .EXE using ActiveState's ActivePerl and Perl Dev Kit.

Up until now I have been accessing Pervasive.SQL via the popular DBI + ODBC combination (having used Win32::ODBC in my early days of attacking databases with Perl), which to me is the simplest and quickest solution. Therefore these pages will concentrate on this mechanism for the forseeable future. Using ODBC with Pervasive.SQL (particularly older versions of the latter) does have its issues and I have started investigating other ways of accessing the database, e.g. using Win32::API, Inline::C and some Pervasive.SQL/Btrieve-specific packages that have been on CPAN for a while - if any of these alternatives prove feasible I will include the details here later on.

Go to accessing Pervasive.SQL with Perl + DBI + ODBC

Go to accessing Pervasive.SQL with Perl + Win32::ODBC (and Win32::DBIODBC)

Go to accessing Pervasive.SQL with Perl + Win32::API

Go to accessing Pervasive.SQL with Perl + ADO (work in progress)


  1. Most of these solutions should work with any version of Pervasive.SQL from 2000 to 12, although most have only been tested on 2000i, 9.5, 10.x or 12. Although Pervasive.SQL has been released over the years on various *nix platforms (and I even had luck accessing it on Mac OSX in version 2000i with the JDBC driver when the latter was, and with version 11 still is, a type 4 driver), all of my development for the last few years has been on Windows (32-bit and 64-bit) using the 32-bit Perl interpreter. Therefore I am unable to test how much of the material applies to other platforms...sorry :-(
  2. Actian PSQL 13 (soon to be rebranded as Actian Zen Embedded) introduces a new Btrieve 2 C/C++ API along with SWIG files for accessing this in Perl (and Python and PHP). There does not appear to be any documentation on Perl/SWIG access on the Actian website at present (September 2017) and I am not yet using v13 - I will add examples here when/if I do.



Finally, this disclaimer applies to these pages, as do these privacy policies.


Home Links ODBC (DBI) Contact

All content on this site is copyright
Neil Hughes 2010 - 2018