HOME

TheInfoList



OR:

Embedded SQL is a method of combining the
computing Computing is any goal-oriented activity requiring, benefiting from, or creating computing machinery. It includes the study and experimentation of algorithmic processes, and development of both hardware and software. Computing has scientific, ...
power of a
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming l ...
and the
database In computing, a database is an organized collection of data stored and accessed electronically. Small databases can be stored on a file system, while large databases are hosted on computer clusters or cloud storage. The design of databases spa ...
manipulation Manipulation may refer to: * Manipulation (psychology) - the action of manipulating someone in a clever or unscrupulous way * Crowd manipulation - use of crowd psychology to direct the behavior of a crowd toward a specific action ::*Internet mani ...
capabilities of SQL. Embedded SQL
statements Statement or statements may refer to: Common uses * Statement (computer science), the smallest standalone element of an imperative programming language *Statement (logic), declarative sentence that is either true or false *Statement, a declarativ ...
are SQL statements written inline with the program
source code In computing, source code, or simply code, is any collection of code, with or without comment (computer programming), comments, written using a human-readable programming language, usually as plain text. The source code of a Computer program, p ...
, of the host language. The embedded SQL statements are parsed by an embedded SQL
preprocessor In computer science, a preprocessor (or precompiler) is a program that processes its input data to produce output that is used as input in another program. The output is said to be a preprocessed form of the input data, which is often used by s ...
and replaced by host-language calls to a code
library A library is a collection of materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or digital access (soft copies) materials, and may be a physical location or a vi ...
. The output from the preprocessor is then compiled by the host
compiler In computing, a compiler is a computer program that translates computer code written in one programming language (the ''source'' language) into another language (the ''target'' language). The name "compiler" is primarily used for programs that ...
. This allows programmers to embed SQL statements in programs written in any number of languages such as
C/C++ The C and C++ programming languages are closely related but have many significant differences. C++ began as a fork of an early, pre- standardized C, and was designed to be mostly source-and-link compatible with C compilers of the time. Due to t ...
,
COBOL COBOL (; an acronym for "common business-oriented language") is a compiled English-like computer programming language designed for business use. It is an imperative, procedural and, since 2002, object-oriented language. COBOL is primarily ...
and Fortran. This differs from SQL-derived programming languages that don't go through discrete preprocessors, such as
PL/SQL PL/SQL (Procedural Language for SQL) is Oracle Corporation's procedural extension for SQL and the Oracle relational database. PL/SQL is available in Oracle Database (since version 6 - stored PL/SQL procedures/functions/packages/triggers since ...
and
T-SQL Transact-SQL (T-SQL) is Microsoft's and Sybase's proprietary extension to the SQL (Structured Query Language) used to interact with relational databases. T-SQL expands on the SQL standard to include procedural programming, local variables, vari ...
. The 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. 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. Host language C and embedded SQL, for example, is called Pro*C in
Oracle An oracle is a person or agency considered to provide wise and insightful counsel or prophetic predictions, most notably including precognition of the future, inspired by deities. As such, it is a form of divination. Description The wor ...
and
Sybase Sybase, Inc. was an enterprise software and services company. The company produced software to manage and analyze information in relational databases, with facilities located in California and Massachusetts. Sybase was acquired by SAP in 2010; ...
database management systems, ESQL/C in
Informix IBM Informix is a product family within IBM's Information Management division that is centered on several relational database management system (RDBMS) offerings. The Informix products were originally developed by Informix Corporation, whose ...
, and ECPG in the
PostgreSQL PostgreSQL (, ), also known as Postgres, is a free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance. It was originally named POSTGRES, referring to its origins as a successor to the In ...
database management system. SQL may also be embedded in languages like PHP etc.


Systems that support embedded SQL


Altibase

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


IBM Db2

IBM Db2 Db2 is a family of data management products, including database servers, developed by IBM. It initially supported the relational model, but was extended to support object–relational features and non-relational structures like JSON and ...
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.


IBM Informix

IBM Informix IBM Informix is a product family within IBM's Information Management division that is centered on several relational database management system (RDBMS) offerings. The Informix products were originally developed by Informix Corporation, whose ...
version 14.10 for Linux, Unix, and Windows supports embedded SQL for C. }


Microsoft SQL Server

; C/C++ : Embedded SQL for C has been deprecated as of
Microsoft SQL Server Microsoft SQL Server is a relational database management system developed by Microsoft. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applications—which ...
2008 although earlier versions of the product support it.


Mimer SQL

Mimer SQL Mimer SQL is an SQL-based relational database management system produced by the Swedish company ''Mimer Information Technology AB'' (Mimer AB), formerly known as ''Upright Database Technology AB''. It was originally developed as a research proje ...
for Linux,
macOS macOS (; previously OS X and originally Mac OS X) is a Unix operating system developed and marketed by Apple Inc. since 2001. It is the primary operating system for Apple's Mac (computer), Mac computers. Within the market of ...
,
OpenVMS OpenVMS, often referred to as just VMS, is a multi-user, multiprocessing and virtual memory-based operating system. It is designed to support time-sharing, batch processing, transaction processing and workstation applications. Customers using Ope ...
and Windows support embedded SQL. ; C/C++ : Embedded SQL for C/C++ is supported on Linux, macOS, OpenVMS and Windows. ; COBOL : Embedded SQL for COBOL is supported on OpenVMS. ; Fortran : Embedded SQL for Fortran is supported on OpenVMS.


Oracle Database

; Ada : Pro*Ada was officially desupported by
Oracle An oracle is a person or agency considered to provide wise and insightful counsel or prophetic predictions, most notably including precognition of the future, inspired by deities. As such, it is a form of divination. Description The wor ...
in version 7.3. Starting with Oracle8, Pro*Ada was replaced by SQL*Module but appears to have not been updated since. 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 11''g''. ; COBOL : Pro*COBOL is currently supported as of Oracle Database 11''g''. ; Fortran : Pro*FORTRAN is no longer updated as of Oracle8 but Oracle will continue to issue patch releases as bugs are reported and corrected. ; Pascal : Pro*Pascal was not released with Oracle8. ;
PL/I PL/I (Programming Language One, pronounced and sometimes written PL/1) is a procedural, imperative computer programming language developed and published by IBM. It is designed for scientific, engineering, business and system programming. It ...
: Pro*PL/I was not released with Oracle8. The ''Pro*PL/I Supplement to the Oracle Precompilers Guide'', however, continued to make appearances in the Oracle Documentation Library until release 11''g''. As of release 12c, the Pro*PL/I has been removed from the Oracle Documentation Library.


PostgreSQL

; C/C++ : ECPG is part of
PostgreSQL PostgreSQL (, ), also known as Postgres, is a free and open-source relational database management system (RDBMS) emphasizing extensibility and SQL compliance. It was originally named POSTGRES, referring to its origins as a successor to the In ...
since version 6.3. ; COBOL : Cobol-IT is now distributing a COBOL precompiler for PostgreSQL : Micro Focus provides support via their OpenESQL preprocessor


SAP Sybase

SAP Sybase ASE 15.7 supports embedded SQL for C and COBOL as part of the Software Developer Kit
Sybase Sybase, Inc. was an enterprise software and services company. The company produced software to manage and analyze information in relational databases, with facilities located in California and Massachusetts. Sybase was acquired by SAP in 2010; ...
. SAP Sybase SQL Anywhere supports embedded SQL for C and C++ as part of the SQL Anywhere database management system SQL Anywhere. SAP Sybase IQ supports embedded SQL for C and C++ as part of the Sybase IQ database management system Sybase IQ.{{cite web , url=http://www54.sap.com/pc/tech/database/software/sybase-iq-big-data-management/index.html , title=SAP Sybase IQ , work=SAP Sybase Products , publisher=SAP Sybase , accessdate=2013-05-02 , archive-url=https://web.archive.org/web/20130504025213/http://www54.sap.com/pc/tech/database/software/sybase-iq-big-data-management/index.html , archive-date=2013-05-04 , url-status=dead


Embedded SQL through domain-specific languages

* LINQ-to-SQL embeds a SQL-like language into
.NET languages CLI languages are computer programming languages that are used to produce libraries and programs that conform to the Common Language Infrastructure (CLI) specifications. With some notable exceptions, most CLI languages compile entirely to the Com ...
. * JPA embeds a SQL-like language throug
Criteria API
into
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
. * jOOQ embeds a SQL-like language into
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's mo ...
.


See also

*
Language binding In programming and software design, binding is an application programming interface (API) that provides glue code specifically made to allow a programming language to use a foreign library or operating system service (one that is not native to ...
*
PL/SQL PL/SQL (Procedural Language for SQL) is Oracle Corporation's procedural extension for SQL and the Oracle relational database. PL/SQL is available in Oracle Database (since version 6 - stored PL/SQL procedures/functions/packages/triggers since ...
* Pro*C/C++ *
SQL/OLB SQL/OLB, or ''Object Language Bindings'', is a standard for embedding SQL in Java, commonly known by its prior name as SQLJ (part 0). Besides describing the syntax and semantics of SQLJ, which are typically given relative to JDBC, the standard also ...
* SQL PL *
Transact-SQL Transact-SQL (T-SQL) is Microsoft's and Sybase's proprietary extension to the SQL (Structured Query Language) used to interact with relational databases. T-SQL expands on the SQL standard to include procedural programming, local variables, vario ...


References


External links


Introduction to Pro*C Embedded SQL



SQL*Module for Ada Programmer's Guide, Release 8.0




SQL Declarative programming languages Query languages Data modeling languages Database APIs SQL data access