Software needed
Spanish version (Versión en Español)
UESQLC Universal Embedded SQL Compiler


UESQLC is an Open Source embedded SQL-92 precompiler for C++ and JAVA, designed to be extensible using SGML documents. It lets users access multiple relational database management systems from a single source program. Furthermore, it can verify the three levels of SQL conformance (Entry, Intermediate and Full).

The distribution includes SGML documents that target Oracle Server OCI, PostgreSQL LIBPQ, PostgreSQL JDBC and ODBC database programming interfaces (on Unix/Linux it has been tested with UnixODBC). UESQLC is distributed under the terms of the GNU General Public License (GPL).


To build the documentation of both UESQLC and MPCL, you must use DOXYGEN, which will generate the documentation in PostScript, DVI, Man (Unix) and HTML formats. In the following pages you can find the HTML documentation for UESQLC and MPCL.


UESQLC has been written in C++ using the MPCL library (see below). It was developed on Linux and it was tested on Linux (with PostgreSQL LIBPQ) and Sun Solaris (with Oracle Server OCI) but ports to other operating systems are welcome.

See README, ChangeLog and NEWS for UESQLC and README, ChangeLog and NEWS for MPCL.

Here is a table with the platforms where the compiler has been compiled and tested.

Canonical system name from config.guess

Here is a table with the available targets.

Target (CDML filename) DBMS API API version
odbc-3.x any with ODBC support ODBC >= 3.x
oracle-oci-7.x Oracle Server OCI (Oracle Call Interface) >= 7.x
postgresql-jdbc-3.0 PostgreSQL JDBC >= 3.0
postgresql-libpq-6.2.x PostgreSQL LIBPQ >= 6.2.x

The scanner and parser for SQL-92, has been written from scratch. It supports SQL-92 but character sets and modules. Where this precompiler shines is in the possibility of creating new targets (MySQL, Informix SQL, etc.) by simply writing a new SGML document (formally CDML document) and without having to recompile the compiler. Furthermore, you can build a CDML document for an API that doesn't support SQL but an equivalent query language.

With the use of the GNU tools, autoconf, automake and libtool, the portability level of the compiler is very high.


This is an example of UESQL code (embedded in C++) for connecting to a DBMS, creating a table and browsing the result of a SELECT statement. Later, the table is dropped.

    uesqlc::TString    yCode;
    uesqlc::TInteger   tWorkerCount;
    extern "UESQL::default"
      whenever not found goto not_found;
      connect to '' user 'myname';
      create table JOBS
        CODE         character (3) not null ,
        WORKER_COUNT integer
      insert into JOBS values ('001', 100);
      insert into JOBS values ('002', 250);
      declare MYCURSOR cursor for
        select CODE, WORKER_COUNT
          from JOBS
          where ( WORKER_COUNT > 50 );
      open MYCURSOR;
    cout << "CODE WORKER_COUNT" << endl;
    cout << "==== ============" << endl;
    while ( true )
      extern "UESQL::default"
        fetch from MYCURSOR into :yCode, :tWorkerCount;
      cout << yCode << "  " << tWorkerCount << endl;

    extern "UESQL::default"
      close MYCURSOR;
      drop table JOBS cascade;

Software needed

Name Version needed
GNU g++ >= 3.1
GNU make any
JAVA 1.4


UESQLC and MPCL are available here and distribution is governed by the terms of the GNU General Public License and GNU Library General Public License respectively.

All sources and binaries. Download directory
Sources for UESQLC.
Sources for MPCL.


UESQLC (and MPCL) are Open Source software, and contributions, in terms of bug reports, ideas, documentation, and patches, are welcome.

Its ability to survive and be successful will greatly depend upon the contributions of others. You do not have to know how to code to contribute, although it does help. The current TODO list is:

  • Programming related contributions.

    • Compilation in other platforms (Solaris, BSD, AIX...).

    • Add new targets for C++ (Informix, SAP-DB, MySQL, etc.).

    • Add support for Java as host language (besides C++) (done).

    • Add PostgreSQL as new target for JAVA JDBC (done).

    • New ports (Alpha, SGI, etc.).

    • Convert MPCL/ADT (Abstract Data Types) to STL (done).

    • Internationalization of compiler using locale.

  • Non-programming related contributions.

    • Documentation (with DOXYGEN) (done).

    • Info files, HOWTOs, FAQs, etc.

    • Suggestions for Web pages, fixes and spelling errors (my English isn't very good) (done).

Please tell me how do you feel about the software.


UESQLC has been written by Rafael Jesús Alcántara Pérez with the support of the professor (and friend) Sergio Gálvez Rojas as Master Thesis Director in the University of Málaga. If you want commercial support for this project, please contact with Dédalo Ingenieros, S.L.

MPCL has been written by Rafael Jesús Alcántara Pérez as main coder, and Francisco Rodrigo Escobedo Robles, Angel Jiménez Jiménez, Carlos Jiménez Moreno and Francisco Vides Fernández.

Copyright © 1996-2009 by Rafael Jesús Alcántara Pérez.
This page was last modified on January 27 2009.