 |
» |
|
|
 |
In every ALLBASE/SQL Pascal program, you embed SQL commands
in the declaration section and the procedure section of your program to: - 1
Declare the SQL Communications Area (SQLCA).
- 2
Declare host variables.
- 3
Start a DBE session by connecting to the DBEnvironment.
- 4 5
Define transactions.
- 6
Implicitly check the status of SQL command execution.
- 7
Terminate the DBE session.
- 8
Define or manipulate data in the DBEnvironment.
- 9
Explicitly check the status of SQL command execution.
- 10
Obtain error and warning messages from the ALLBASE/SQL message
catalog.
The program listing shown in Figure 3-1
illustrates where in a main program
you can embed SQL commands to accomplish the activities listed above.
In a subprogram, host variable declarations cannot be in the global
declaration part. This chapter is a high-level road map to the logical and
physical aspects of embedding SQL commands in a program. It
addresses the reasons for embedding commands to perform the
above activities. It also gives general rules for how and where
to embed SQL commands for these activities. First however,
it shows a program containing commands for the basic SQL functions listed above.
Then it describes the general rules that apply when you embed any
SQL command, referring to the numbered statements in the program.
|