![]() | ![]() |
Home |
|
|
|
| Chapter 2: The Embedded SQL Interface |
|
| Embedded SQL commands |
Note:EXEC SQL
ALL Embedded SQL statements must be preceded with EXEC SQL and end with a semicolon.
There are two groups of Embedded SQL commands:
Standard SQL commands are used by simply placing them in a C program enclosed with EXEC SQL and a semi-colon. CONNECT, DELETE, SELECT, SET and UPDATE have additional formats only available in Embedded SQL. The additional formats fall into the second category of Embedded SQL specific commands.
All commands are described in detail in SQL Statements .
Several SQL commands are specific to Embedded SQL and can only be used in a C program.
These Embedded SQL commands are also described in SQL Language Elements .
The Embedded SQL commands include the following:
ALLOCATE DESCRIPTOR
Allocate memory for a descriptor
CLOSE
close a cursor
CONNECT
connect to the database
DEALLOCATE DESCRIPTOR
Reclaim memory for a descriptor
Declaration Section
declare host variables for database communication
DECLARE
declare a cursor
DELETE (positioned)
delete the row at the current position in a cursor
DESCRIBE
describe the host variables for a particular SQL statement
DISCONNECT
disconnect from database server
DROP STATEMENT
free resources used by a prepared statement
EXECUTE
execute a particular SQL statement
EXPLAIN
explain the optimization strategy for a particular cursor
FETCH
fetch a row from a cursor
GET OPTION
get the setting for a particular database option
INCLUDE
include a file for SQL preprocessing
OPEN
open a cursor
PREPARE
prepare a particular SQL statement
PUT
insert a row into a cursor
SET CONNECTION
change active connection
SET OPTION
change a database option value
SET SQLCA
use an SQLCA other than the default global one
UPDATE (positioned)
update the row at the current location of a cursor
WHENEVER
specify actions to occur on errors in SQL statements
|
|