Module SQL

Last updated

Module SQL is a method of combining the computing power of a programming language and the database manipulation capabilities of SQL. Module SQL statements are SQL statements written in an SQL client module, that can be called as routines from the host language program source code like a host language routine. An SQL standard Module Language file is compiled into calls to a SQL runtime library that interacts with the Database management system. This allows programmers to call SQL statements from applications written in regular programming languages.

Contents

Using Module Language is very straightforward: place all SQL code in a separate module, and define an interface between the module containing the SQL code and the host program. [1]

Module SQL is closely related to Embedded SQL. "SQL client modules are self-contained collections of SQL statements. Unlike embedded SQL, in which the SQL statements are inserted into the host programming language, SQL client modules are separate from the host language. The host language contains calls that invoke the module, which in turn executes the SQL statements within that module." [2]

SQL Standard Compliance

The SQL:2023 standard (ISO/IEC 9075-2:2023 Information technology — Database languages SQL — Part 2: Foundation (SQL/Foundation), chapter 13 [3] ) defines an SQL module as an SQL client module, and the language in which SQL queries are called is referred to as the host language. Specified host languages are:

(All the languages listed above are optional features, which means that each vendor can decide which language(s) to support.)

Database systems that support module SQL

Mimer SQL

Mimer SQL 11.0 and later for Linux, macOS, OpenVMS and Windows support module SQL for C/C++, and Mimer SQL for OpenVMS also supports module SQL for COBOL, Fortran and Pascal. [4]

Oracle Database

Oracle 8.0 supported SQL*Module for Ada but support has been removed in later versions. [5] SQL*Module is a module language that supports the Ada83 language standard for Ada. [6]

Oracle Rdb

Supported host languages are Ada, BASIC, C, COBOL, Fortran, Pascal and PL/I. [7]

Related Research Articles

PL/I is a procedural, imperative computer programming language initially developed by IBM. It is designed for scientific, engineering, business and system programming. It has been in continuous use by academic, commercial and industrial organizations since it was introduced in the 1960s.

Structured Query Language (SQL) is a domain-specific language used to manage data, especially in a relational database management system (RDBMS). It is particularly useful in handling structured data, i.e., data incorporating relations among entities and variables.

In computing, Open Database Connectivity (ODBC) is a standard application programming interface (API) for accessing database management systems (DBMS). The designers of ODBC aimed to make it independent of database systems and operating systems. An application written using ODBC can be ported to other platforms, both on the client and server side, with few changes to the data access code.

The Call Level Interface (CLI) is an application programming interface (API) and software standard to embed Structured Query Language (SQL) code in a host program as defined in a joint standard by the International Organization for Standardization (ISO) and International Electrotechnical Commission (IEC): ISO/IEC 9075-3:2003. The Call Level Interface defines how a program should send SQL queries to the database management system (DBMS) and how the returned recordsets should be handled by the application in a consistent way. Developed in the early 1990s, the API was defined only for the programming languages C and COBOL.

Mimer SQL is a proprietary SQL-based relational database management system produced by the Swedish company Mimer Information Technology AB, formerly known as Upright Database Technology AB. It was originally developed as a research project at the Uppsala University, Uppsala, Sweden in the 1970s before being developed into a commercial product.

<span class="mw-page-title-main">History of programming languages</span> History of languages used to program computers

The history of programming languages spans from documentation of early mechanical computers to modern tools for software development. Early programming languages were highly specialized, relying on mathematical notation and similarly obscure syntax. Throughout the 20th century, research in compiler theory led to the creation of high-level programming languages, which use a more accessible syntax to communicate instructions.

In computer programming, a statement is a syntactic unit of an imperative programming language that expresses some action to be carried out. A program written in such a language is formed by a sequence of one or more statements. A statement may have internal components.

In computer science, the Boolean is a data type that has one of two possible values which is intended to represent the two truth values of logic and Boolean algebra. It is named after George Boole, who first defined an algebraic system of logic in the mid 19th century. The Boolean data type is primarily associated with conditional statements, which allow different actions by changing control flow depending on whether a programmer-specified Boolean condition evaluates to true or false. It is a special case of a more general logical data type—logic does not always need to be Boolean.

<span class="mw-page-title-main">PL/pgSQL</span>

PL/pgSQL is a procedural programming language supported by the PostgreSQL ORDBMS. It closely resembles Oracle's PL/SQL language. Implemented by Jan Wieck, PL/pgSQL first appeared with PostgreSQL 6.4, released on October 30, 1998. Version 9 also implements some ISO SQL/PSM features, like overloading of SQL-invoked functions and procedures.

The following tables compare general and technical information for a number of relational database management systems. Please see the individual products' articles for further information. Unless otherwise specified in footnotes, comparisons are based on the stable versions without any add-ons, extensions or external programs.

Language-Sensitive Editor (LSE) is a full-screen visual editor for the VAX/VMS and OpenVMS Operating systems. LSE is implemented by using the Text Processing Utility (TPU) language. It is part of the DECset programming tool set, which also contains a test manager, the performance and coverage analyzer (PCA), a code management system (CMS), and a module management mystem (MMS).

Programming languages are used for controlling the behavior of a machine. Like natural languages, programming languages follow rules for syntax and semantics.

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. This differs from SQL-derived programming languages that don't go through discrete preprocessors, such as PL/SQL and T-SQL.

This comparison of programming languages compares the features of language syntax (format) for over 50 computer programming languages.

SQL/PSM is an ISO standard mainly defining an extension of SQL with a procedural language for use in stored procedures. Initially published in 1996 as an extension of SQL-92, SQL/PSM was later incorporated into the multi-part SQL:1999 standard, and has been part 4 of that standard since then, most recently in SQL:2023. The SQL:1999 part 4 covered less than the original PSM-96 because the SQL statements for defining, managing, and invoking routines were actually incorporated into part 2 SQL/Foundation, leaving only the procedural language itself as SQL/PSM. The SQL/PSM facilities are still optional as far as the SQL standard is concerned; most of them are grouped in Features P001-P008.

SQL:1999 was the fourth revision of the SQL database query language. It introduced many new features, many of which required clarifications in the subsequent SQL:2003. In the meanwhile SQL:1999 is deprecated.

OS 2200 has had several generations of compilers and linkers in its history supporting a wide variety of programming languages. In the first releases, the Exec II assembler (SLEUTH) and compilers were used. The assembler was quickly replaced with an updated version (ASM) designed specifically for the 1108 computer and Exec 8 but the early compilers continued in use for quite some time.

Programming languages have been classified into several programming language generations. Historically, this classification was used to indicate increasing power of programming styles. Later writers have somewhat redefined the meanings as distinctions previously seen as important became less significant to current practice.

PL/SQL is Oracle Corporation's procedural extension for SQL and the Oracle relational database. PL/SQL is available in Oracle Database, Times Ten in-memory database, and IBM Db2. Oracle Corporation usually extends PL/SQL functionality with each successive release of the Oracle Database.

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 2023-03-30.
  2. Oppel, Andrew (November 2015). SQL: A Beginner's Guide, Fourth Edition, 4th Edition (4th ed.). McGraw-Hill. p. 544. ISBN   978-0071842594.
  3. "SQL Standard 2023, Chapter 13 SQL-client modules". ISO/IEC 9075-2:2023 Information technology — Database languages — SQL — Part 2: Foundation (SQL/Foundation). ISO . Retrieved 2023-06-05.
  4. "Module SQL". Mimer SQL Programmer's Manual latest version, Module SQL. Mimer SQL.
  5. "SQL*Module™ for Ada - Programmer's Guide" (PDF). Oracle Corporation. Retrieved 2023-06-19.
  6. "Ada Support in Version 8". Oracle9i Database Migration, Release 2 (9.2), Chapter 5. Compatibility and Interoperability. Oracle Corporation. Retrieved 2023-03-30.
  7. "Oracle Rdb7™, Guide to SQL Programming" (PDF). Oracle Corporation. Retrieved 2023-06-05.