ALL embedded SQL statements must be preceded with EXEC SQL and end with a semicolon (;).
There are two groups of embedded SQL statements. Standard SQL statements are used by simply placing them in a C program enclosed with EXEC SQL and a semicolon (;). 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 statements.
For descriptions of the standard SQL statements, see SQL statements.
Several SQL statements are specific to embedded SQL and can only be used in a C program. See SQL language elements.
Standard data manipulation and data definition statements can be used from embedded SQL applications. In addition the following statements are specifically for embedded SQL programming:
ALLOCATE DESCRIPTOR allocate memory for a descriptor. See ALLOCATE DESCRIPTOR statement [ESQL].
CLOSE close a cursor. See CLOSE statement [ESQL] [SP].
CONNECT connect to the database. See CONNECT statement [ESQL] [Interactive SQL].
DEALLOCATE DESCRIPTOR reclaim memory for a descriptor. See DEALLOCATE DESCRIPTOR statement [ESQL].
Declaration section declare host variables for database communication. See Declaration section [ESQL].
DECLARE CURSOR declare a cursor. See DECLARE CURSOR statement [ESQL] [SP].
DELETE (positioned) delete the row at the current position in a cursor. See DELETE (positioned) statement [ESQL] [SP].
DESCRIBE describe the host variables for a particular SQL statement. See DESCRIBE statement [ESQL].
DISCONNECT disconnect from database server. See DISCONNECT statement [ESQL] [Interactive SQL].
DROP STATEMENT free resources used by a prepared statement. See DROP STATEMENT statement [ESQL].
EXECUTE execute a particular SQL statement. See EXECUTE statement [ESQL].
EXPLAIN explain the optimization strategy for a particular cursor. See EXPLAIN statement [ESQL].
FETCH fetch a row from a cursor. See FETCH statement [ESQL] [SP].
GET DATA fetch long values from a cursor. See GET DATA statement [ESQL].
GET DESCRIPTOR retrieve information about a variable in a SQLDA. See GET DESCRIPTOR statement [ESQL].
GET OPTION get the setting for a particular database option. See GET OPTION statement [ESQL].
INCLUDE include a file for SQL preprocessing. See INCLUDE statement [ESQL].
OPEN open a cursor. See OPEN statement [ESQL] [SP].
PREPARE prepare a particular SQL statement. See PREPARE statement [ESQL].
PUT insert a row into a cursor. See PUT statement [ESQL].
SET CONNECTION change active connection. See SET CONNECTION statement [Interactive SQL] [ESQL].
SET DESCRIPTOR describe the variables in a SQLDA and place data into the SQLDA. See SET DESCRIPTOR statement [ESQL].
SET SQLCA use a SQLCA other than the default global one. See SET SQLCA statement [ESQL].
UPDATE (positioned) update the row at the current location of a cursor. See UPDATE (positioned) statement [ESQL] [SP].
WHENEVER specify actions to occur on errors in SQL statements. See WHENEVER statement [ESQL].
Discuss this page in DocCommentXchange.
|
Copyright © 2010, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.0 |