Embedding SQL statements in a host language

Structured Query Language (SQL) is a standardized language that you can use to manipulate database objects and the data that they contain. Despite differences between host languages, embedded SQL applications are made up of three main elements that are required to setup and issue an SQL statement.
The elements you must create when you write an embedded SQL application include:
  1. A DECLARE SECTION for declaring host variables. The declaration of the SQLCA structure does not need to be in the DECLARE section.
  2. The main body of the application, which consists of the setup and execution of SQL statements.
  3. Placements of logic that either commit or rollback the changes made by the SQL statements.
For each host language, there are differences between the general guidelines, which apply to all languages, and rules that are specific to individual languages.