Database Reference
In-Depth Information
Example 50: The following are examples of the use of such commands:
To clear the format command settings, you use the format clearing statements. The
syntax of two such commands are as follows:
12.14 Embedded SQL
When developing applications for industrial or commercial purposes, SQL is typically
used as a database language that is used by the software engineer when it is convenient to
do so. What this often means is that an application program may be written in a high level
language (such as Pascal, C++, Java, etc.), but containings embedded SQL statements to
take care of database access issues.
The general convention for embedded SQL is as follows:
Wherever a column, literal or scalar expression is applicable in an
SQL statement, a program variable, or scalar expression involving
programming variables, may be applied.
In many languages, the convention for specifying program
variable is to precede the variable with a colon (:). One exception
to this rule is Oracle's PL/SQL, where a program variable is
preceded either by the ampersand (&) in the case of execution-
time variables, or nothing at all.
In the case where data is to be retrieved into program variables,
the Select statement is specified with an Into-Clause . The
required syntax is shown below.
In the case where a query will produce multiple rows, a
cursor is
set up. Although cursors are implemented differently from one
host language to the other, the general principle is somewhat
similar: A full discussion of cursors is beyond the scope of
this course; suffice it to say that a cursor is a holding area for
rows retrieved by a query. Cursors are normally used in stored
procedures (in the host language), where multiple rows are
retrieved for subsequent usage.
 
Search WWH ::




Custom Search