Mimer SQL Documentation TOC PREV NEXT INDEX

Mimer SQL Developer Site

http://developer.mimer.com


DECLARE SECTION


Identifies declaration of host variables used in SQL statements.

Usage

Embedded.

Description

Host variables declared between the BEGIN DECLARE SECTION and END DECLARE SECTION statements are declared for both the host language compiler and the SQL compiler. Host variables used in SQL statements must be declared in an SQL DECLARE SECTION.

Restrictions

None.

Notes

Host variables declared in the SQL DECLARE SECTION must 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 SECTION in the host program code and for declaring variables within the SECTION follow the host language syntax.

Language-specific issues are discussed in the Mimer SQL Programmer's Manual, Appendix A, Host Language Dependent Aspects, page 137.

SQL statements may not be placed within the SQL DECLARE SECTION.

Note: BEGIN DECLARE SECTION and END DECLARE SECTION are two separate SQL statements, each of which must be preceded by EXEC SQL and 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 usernm[129];
    CHAR passwd[19];
 EXEC SQL END DECLARE SECTION;
 

Standard Compliance

Standard
Compliance
Comments
X/Open-95
SQL-92
YES
Fully compliant.



Upright Database Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40
dbtechnology@upright.se
Mimer SQL Documentation TOC PREV NEXT INDEX