Comprehensive TeX Archive Network

Direc­tory tex-archive/support/SQLTeX

SQLTeX v1.5

SQLTeX is a preprocessor to enable the use of SQL statements in LaTeX.
It is a perl script that reads an input file containing the SQL commands,
and writes a LaTeX file that can be processed with your LaTeX package.

The SQL commands will be replaced by their values. It's possible to select
a single field for substitution substitution in your LaTeX document, or to
be used as input in another SQL command.

When an SQL command returns multiple fields and or rows, the values can only
be used for substitution in the document.

Installing SQLTeX

Before installing SQLTeX, you need to have it. The latest version can always
be found at http://software.oveas.net/sqltex.
The download consists of this readme, documentation in LaTeX and HTML format,
an installation script for Unix (install), the Perl script SQLTeX and the
default replace file.

On a Unix system, make sure the file install is executable by issueing
the command:
  bash$ chmod +x install
then execute it with:
  bash$ ./install

The script will ask in which directory SQLTeX should be installed. If you are
logged in as `root', the default will be /usr/local/bin, otherwise the
current directory.
Make sure the directory where SQLTeX is installed is in your path.

For other operating systems, there is no install script, you will have to install
it manually.

On OpenVMS it would be something like:
However, on OpenVMS you also need to define the command SQLTEX by setting a symbol,
either in the LOGIN.COM for all users who need to execute this script, or in some
group-- or system wide login procedure, with the command:
For more information, please refer to the LaTeX documentation.

* Perl        (http://perl.org/)
* Perl-DBI    (http://dbi.perl.org/)
* The DBI driver for your database (see: http://search.cpan.org/search?query=DBD%3A%3A&mode=module)

Note for MAC users:
If DBI and the database driver are not yet installed, Xtools needs to be
installed in advance, since gcc is not available in a standard install
of Mac OS X.

Thanks to:
Ingo Reich       for the comment on Mac OS
Johan W. Klüwer  for verifying the SyBase support
Paolo Cavallini  for adding PostgreSQL support

v1.5 (2007-11-23):
- Support for multiple database drivers
- Added NEWLINE directive as row seperator
- Multidocument support
- Implemented updates

v1.4 (2002-05-02):
- Implemented replace files

The latest release is always available at http://freeware.oveas.com/sqltex
For bugs, questions and comments, please contact me at

This software is subject to the terms of the LaTeX Project Public License; 
see http://www.ctan.org/tex-archive/help/Catalogue/licenses.lppl.html
Copyright (c) 2001-2007 - Oscar van Eijk, Oveas Functionality Provider


Name Size Date Notes
README 3155 2007-11-23 20:28
SQLTeX.pdf 130483 2007-11-23 12:46
SQLTeX.pl 23920 2007-11-23 11:48
SQLTeX.tex 29126 2007-11-23 12:46
SQLTeX_r.dat 672 2002-05-02 15:49
in­stall 2511 2007-11-23 13:19

Down­load the con­tents of this pack­age in one zip archive (129.2k).

SQLTeX – An SQL Pre­pro­ces­sor for LaTeX

SQLTeX is a pre­pro­ces­sor that en­ables the use of SQL state­ments in LaTeX. The SQLTeX perl script reads an in­put file con­tain­ing the LaTeX source with SQL com­mands, and writes a LaTeX file in which the SQL com­mands have been re­placed by the val­ues from their ex­e­cu­tion. It is pos­si­ble to se­lect a field for sub­sti­tu­tion in your LaTeX doc­u­ment, or to be used as in­put in an­other SQL com­mand. (When an SQL com­mand re­turns mul­ti­ple fields and or rows, the val­ues can only be used within the doc­u­ment.

The de­fault is to use MySQL databases, but Pg, Sy­base, Or­a­cle, In­gres, mSQL and Post­greSQL are also sup­ported.

Pack­age De­tailsSQLTeX
Li­censeThe LaTeX Project Public Li­cense
Copy­right2001–2007 Os­car van Eijk
Main­tainerOs­car van Eijk
Topics ac­cess database for doc­u­ment con­tents
Guest Book Sitemap Contact Contact Author