Perl DB access - ODBC

Perl is popular due to its stability, its free availability on nearly each platform, its performance, and its simplicity to write scripts in order to automate complex tasks.

Besides there is a wide range of extension modules that facilitate the writing of more specific Perl applications by means of an object oriented interface.

One of these modules is DBI, the standard database interface of Perl, that allows relational databases to communicate in a consistent way, independent of the applied database system.


No public sessions are currently scheduled. We will be pleased to set up an on-site course or to schedule an extra public session (in case of a sufficient number of candidates). Interested? Please let us know.

Intended for

Application developers, technical analysts and database administrators who are going to use Perl scripts


Programming experience in Perl, and a basic SQL knowledge (see courses Perl programming: fundamentals course and SQL and relational databases fundamentals).

Knowledge of object oriented concepts is an advantage but not necessary.

Main topics

  • Overview of DBI:
  • Possibilities and restrictions of DBI.
  • Advantages of Perl
  • Link with ODBC and with SQL/CLI
  • Use of DBI: basics
  • Connection with a data base
  • Set-up and execution of a SQL select statement
  • Result processing: multiple rows
  • More SQL: insert/update/delete
  • Using DBI for accessing CSV or Excel files
  • The optimal application of Perl-data structures for DBI.
  • More DBI:
  • The use of host-variables
  • Cursors
  • The database catalog
  • Advanced topics: transactions - locking - performance
  • DBI extensions

Training method

Classroom instruction, theory with exercises, where database connections towards IBM Db2, Oracle, PostgreSQL, SQL Server, or MySQL/MariaDB can be used.


1 day.

Course leader

Peter Vanroose.