Accessing Pervasive.SQL With Perl

Page Last Modified: 07/04/10

Home Links ODBC (DBI) Contact

DBI + ODBC

DBI is a database interface developed and championed by Tim Bunce and the de facto standard for accessing database management systems (DBMS) though a relational-style API (using SQL) even though the underlying database store might be totally unaware of relational concepts, e.g. a simple CSV file. The DBI package relies on DBD drivers to actually implement the DBMS-specific calls. In turn these DBD modules might rely on native drivers to actually interface with the DBMS, e.g. ODBC access to Pervasive.SQL on 32-bit Windows platforms with DBI require DBD::ODBC, a local ODBC driver manager (part of Windows) and native ODBC drivers (installed with the Pervasive.SQL server/workgroup/client application).

There is no native DBI driver for Pervasive.SQL but you can fall back on the trusty DBD::ODBC driver module, also created by Tim Bunce (and Jeff Urlwin) and now being developed by Martin Evans. I use DBD::ODBC to access both Pervasive.SQL and MySQL, and by avoiding any DBMS-specific attributes end up re-using the same code via my own internal library modules, with no modifications.

Using ODBC assumes that your Pervasive.SQL databases have an ODBC datasource set up, which in turn implies that you have DDFs available. Setting up the ODBC datasource is not covered here - see the links page for suitable references.

  1. Connecting To The Database
  2. Fetching Data
  3. Manipulating Data
  4. Transactions

Examples:

  1. Fetching Examples 1 - simple example
  2. Fetching Examples 2 - using die to catch errors
  3. Fetching Examples 3 - using RaiseError to catch errors
  4. Fetching Examples 4 - catching errors using the code
  5. Fetching Examples 5 - using eval to catch errors
  6. INSERT Example
  7. UPDATE Example
  8. DELETE Example
  9. Transaction Example
  10. Testing available drivers and datasources
  11. Connection string variations

Home Links ODBC (DBI) Contact

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