|
|
DECLARE SECTION
Identifies declaration of host variables used in SQL statements.
Usage
Description
Host variables declared between the
BEGIN DECLARE SECTIONandEND DECLARE SECTIONstatements are declared for both the host language compiler and the SQL compiler. Host variables used in SQL statements must be declared in anSQL DECLARE SECTION.Notes
Host variables declared in the
SQL DECLARE SECTIONmust be elementary data items or pointers to character strings. They may not be declared as part of a record or structure.The rules for placing the
DECLARE SECTIONin the host program code and for declaring variables within theSECTIONfollow the host language syntax.Language-specific issues are discussed in the Mimer SQL Programmer's Manual, Appendix A, Host Language Dependent Aspects.
SQL statements may not be placed within the
SQL DECLARE SECTION.
BEGIN DECLARE SECTIONandEND DECLARE SECTIONare two separate SQL statements, each of which must be preceded byEXEC SQLand followed by the (language-specific) statement terminator.Example
The following example, in C, shows the correct usage of both statements:
exec sql BEGIN DECLARE SECTION; char SQLSTATE[6]; char usernm[129], passwd[19]; NVARCHAR tablenm[129]; exec sql END DECLARE SECTION;Standard Compliance
|
Mimer Information Technology AB Voice: +46 18 780 92 00 Fax: +46 18 780 92 40 info@mimer.se |
|
|