2. Introducing SQL : Interactive and Embedded SQL : Embedded SQL : How Embedded SQL Differs From Interactive SQL
 
Share this page                  
How Embedded SQL Differs From Interactive SQL
Embedded SQL statements can be mixed with the full range of host language statements and provide your applications with full access to Ingres databases. The statements available in embedded SQL include those available in interactive SQL; embedded SQL, however, differs from interactive SQL in the following ways:
Use of Host Language Variables - Embedded SQL allows host variables to be used in place of many syntactic elements.
Error and Status Handling - In interactive SQL, error and status messages are sent directly to the terminal screen. Embedded SQL stores error and status information in a data structure called the SQL Communications Area (SQLCA).
Cursors - To enable an application to process the result of a query one row at a time, embedded SQL provides cursor versions of the data manipulation statements SELECT, UPDATE, and DELETE. A database cursor points to the row currently being processed by the application.
Forms Statement - Embedded SQL allows the creation of applications based on forms that have been created through Visual-Forms-Editor (VIFRED). Using forms statements, your application can:
Display VIFRED forms
Transfer data from the form to the database, and vice-versa
Respond to user actions (such as menu selections, control keys, and function keys)
Validate user entries
Display help screens
Dynamic Programming - Embedded SQL allows you to create and execute statements dynamically, specifying portions of SQL statements in program variables at runtime.
The dynamic programming feature of embedded SQL allows you to specify tables, columns, and queries at runtime. Dynamic programming allows generic applications to be written that can be used with any table. Details can be found in Dynamic Programming in the chapter “Embedded SQL.”
Multiple Sessions - An embedded SQL application can use multiple sessions to connect to different databases or to establish multiple connections to the same database.
Additional Database Access Statements - Embedded SQL includes several statements not available in interactive SQL. For example, there are embedded statements that allow your application to connect to a particular database and to manipulate cursors.