SQLTeX(1)

NAME
SQLTeX - a preprocessor to enable the use of SQL statements in LaTeX documents.

SYNOPSIS
sqltex <INPUT-FILE> [PARAMETERS] [OPTIONS]

DESCRIPTION
SQLTeX is a preprocessor to enable the use of SQL statements in LaTeX. It is a tool 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. For a full description, please refer to the PDF documentation.

INPUT-FILE

The input file is required. It is a regular LaTeX file that contains SQLTeX commands for processing. For a detailed description how to create in input files, refer to the SQLTeX documentation.

PARAMETERS
SQL queries in the input file can contain parameters in the form '$PAR<n>' where <n> is a number between 1 and 9, e.g.:

\sqlrow{SELECT * FROM table WHERE field_s = '$PAR1' AND field_i = $PAR2}

These parameters are taken from the commandline.

OPTIONS

-c|--configfile <file>
    SQLTeX configuration file. This option might be disallowed by your systems administrator.

-E|--file-extension <string>
    Replace input file extension in outputfile: 'input.tex' will be 'input.string'. For further notes, see option '--filename-extend'

-N|--null-allowed
    NULL return values allowed. By default SQLTeX exits if a query returns an empty set

-P|--password [password]
    Database password. The value is optional; if omitted, SQLTeX will prompt for a password. This overwrites the password in the input file.

-U|--username user
    Database username

-V|--version
    Print version number and exit

-e|--filename-extend <string>
    Add string to the output filename: 'input.tex' will be 'inputstring.tex'. In 'string', the values between curly braces {} will be substituted:

    Pn  parameter n

    M   current monthname (Mon)

    W   current weekday (Wdy)

    D   current date (yyyymmdd)

    DT  current date and time (yyyymmddhhmmss) -IP T current time (hhmmss)
The options '--file-extension' and '--filename-extend' cannot be used together or with '--output'.

-f|--force
    Force overwrite of existing files

-h|--help
    Print this help message and exit

-m|--multidoc-numbered
    Multidocument mode; create one document for each parameter that is retrieved from the database in the input document (see documentation) This option cannot be used with '--output'.

-M|--multidoc-named
    Same as -m, but with the parameter in the filename i.s.o. a serial number

-o|--output <file>
    Specify an output file. Cannot be used with '--file-extension', '--filename-extend' or the '--multidoc' options.

-S|--skip-empty-lines
    All SQLTeX commands will be removed from the input line or replaced by the corresponding value. The rest of the input line is written to the output file. This includes lines that only contain a SQLTeX command (and a newline character). This will result in an empty line in the output file. By specifying this option, these empty lines will be skipped. Lines that were empty in the input will be written.

-C|--write-comments
    LaTeX comments in the input file will be skipped by default. With this option, comments will also be copied to the output file.

-p|--prefix <prefix>
    Prefix used in the SQLTeX file. Default is 'sql' (see documentation)

-q|--quiet
    Run in quiet mode

-r|--replacementfile <file>
    Specify a file that contains replace characters. This is a list with two tab-separated fields per line. The first field holds a string that will be replaced in the SQL output by the second string.

-R|-rn|--no-replacementfile
    Do not use a replace file. '--replacementfile' '--no-replacementfile' are handled in the same order as they appear on the command line.

-s|--sqlserver <server>
    SQL server to connect to. Default is 'localhost'

-u|--updates
    If the input file contains updates, execute them.

FILES

{SYSCONFDIR}/SQLTeX_r.dat
    Default replacement file. If your installation is part of TEX Live the file will redisde in the same directory as the sqltex executable

{SYSCONFDIR}/SQLTeX.cfg
    Default configuration file. If your installation is part of TEX Live the file will redisde in the same directory as the sqltex executable

{BINDIR}/sqltex
    The sqltex executable. The location might differ depending on your installation type, e.g. as part if the TEX Live distribution.

EXAMPLES

sqltex --filename-extend _{P1}_{W} my_file code

Read input file 'my_file.tex' and generate 'myfile_code_Tue.tex' with the processed results.

sqltex --file-extension _{P1}_{W} my_file code

Read input file 'my_file.tex' and generate 'myfile._code_Tue' with the processed results.

EXIT STATUS

0   Success

1   SQLTeX ended with an error, check the last message.

COPYRIGHT

Copyright 2001-2024 Oscar van Eijk, Oveas Functionality Provider. https://oveas.com 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