Embedded SQL

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Syced (talk | contribs) at 07:17, 29 February 2012 (→‎Oracle Corporation: it makes sense to have a wikilink here even though header already contains one). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Embedded SQL is a method of combining the computing power of a programming language and the database manipulation capabilities of SQL. Embedded SQL statements are SQL statements written inline with the program source code of the host language. The embedded SQL statements are parsed by an embedded SQL preprocessor and replaced by host-language calls to a code library. The output from the preprocessor is then compiled by the host compiler. This allows programmers to embed SQL statements in programs written in any number of languages such as: C/C++, COBOL and Fortran.

The ANSI SQL standards committee defined the embedded SQL standard in two steps: a formalism called Module Language was defined, then the embedded SQL standard was derived from Module Language.[1] The SQL standard defines embedding of SQL as embedded SQL and the language in which SQL queries are embedded is referred to as the host language. A popular host language is C. The mixed C and embedded SQL is called Pro*C in Oracle and Sybase database management systems. In the PostgreSQL database management system this precompiler is called ECPG. Other embedded SQL precompilers are Pro*Ada, Pro*COBOL, Pro*FORTRAN, Pro*Pascal, and Pro*PL/I.

Systems that support Embedded SQL

IBM DB2

IBM DB2 version 9 for Linux, UNIX and Windows supports embedded SQL for C, C++, Java, COBOL, FORTRAN and REXX although support for FORTRAN and REXX has been deprecated.[2]

Oracle Corporation

Ada
Pro*Ada was officially desupported by Oracle in version 7.3. Starting with Oracle8, Pro*Ada has been replaced by SQL*Module but appears to have not been updated since.[3] SQL*Module is a module language that offers a different programming method from embedded SQL. SQL*Module supports the Ada83 language standard for Ada.
C/C++
Pro*C became Pro*C/C++ with Oracle8. Pro*C/C++ is currently supported as of Oracle Database 11g.
COBOL
Pro*COBOL is currently supported as of Oracle Database 11g.
Fortran
Pro*FORTRAN is no longer updated as of Oracle8 but Oracle will continue to issue patch releases as bugs are reported and corrected.[4]
Pascal
Pro*Pascal was not released with Oracle8.[4]
PL/I
Pro*PL/I was not released with Oracle8. The Pro*PL/I Supplement to the Oracle Precompilers Guide, however, continues to make appearances in the Oracle Documentation Library (current as of release 11g).[4]

PostgreSQL

C/C++
ECPG is part of PostgreSQL since version 6.3.
COBOL
Cobol-IT is now distributing a COBOL precompiler for PostgreSQL

Altibase

C/C++
SESC is an embedded SQL precompiler provided by Altibase Corp. for its DBMS server.

Data Access Corporation

With DataFlex 3.2 and Visual DataFlex you can pass SQL statements via one of the Data Access CLI connectivity kits to Microsoft SQL Server, IBM DB2 or any ODBC supporting database. The results can be retrieved and processed.

Microsoft SQL Server

COBOL
Cobol-IT is distributing a Embedded SQL precompiler for COBOL.

MySQL

COBOL
Cobol-IT is distributing a Embedded SQL precompiler for COBOL.

Systems that do not support Embedded SQL

Microsoft SQL Server

Embedded SQL for C has been deprecated as of Microsoft SQL Server 2008 although earlier versions of the product support it.[5]

MySQL

MySQL does not support Embedded SQL.[6]

Sybase

Embedded SQL support has been discontinued by Sybase.[7]

See also

References

  1. ^ "The Module Language Concept". SQL*Module for Ada Programmer's Guide, Release 8.0, Chapter 1. Introduction to SQL*Module. Oracle Corporation. Retrieved 2008-07-14.
  2. ^ "DB2 Database for Linux, UNIX and Windows". Developing Embedded SQL Applications. IBM. Retrieved 2009-04-10.
  3. ^ "Ada Support in Version 8". Oracle9i Database Migration, Release 2 (9.2), Chapter 5. Compatibility and Interoperability. Oracle Corporation. Retrieved 2008-07-14.
  4. ^ a b c "Language Alternatives". Pro*COBOL Precompiler Programmer's Guide, Release 8.0, Chapter 1. Introduction. Oracle Corporation. Retrieved 2008-07-14.
  5. ^ "Deprecated Database Engine Features in SQL Server 2008". SQL Server 2008 Books Online (March 2009). Microsoft. Retrieved 2009-04-10.
  6. ^ "An Open Pre-Compiler for Embedded SQL". MySQL DevZone Articles. Mysql. Retrieved 2009-04-10.
  7. ^ "EmbeddedSQL". Sybase Products. Sybase. Retrieved 2009-04-10.

External links