Using content assist with EXEC SQL statements in C and C++ source files in the Remote C/C++ Editor

The Remote C/C++ Editor provides content assistance for EXEC SQL statements specified in C and C++ source files. When the file has a Db2® z/OS® database associated with it, content assist can also provide assistance for database elements being used by the source file.

Before you begin

The default database used by the Remote C/C++ Editor is that specified in the Editor preference page under Remote C/C++. For more information on Remote C/C++ Editor preferences, see the Setting editor preferences topic. If you want to use a nondefault database, do one of the following tasks before you use content assist: To set preferences for validation and content assist for EXEC SQL statements, use the EXEC SQL Statements preference page. For more information about setting preferences for EXEC SQL statements, see Setting preferences for EXEC SQL statements.

About this task

Content assist for EXEC SQL statements provides the following functions:
  • Syntactic content-assist proposals for embedded SQL statements.
  • Content-assist proposals for database elements being used by the program being edited. These proposals can come from a live database connection or from a database that has an offline cache available.
Note: The Remote C/C++ Editor does not check the syntax of EXEC SQL statements, and any preferences related to syntax checking on the EXEC SQL Statements preference page are ignored by the parser.

Procedure

To content assist with EXEC SQL statements, complete the following step:

Position the cursor within an EXEC SQL statement, and press Ctrl+Spacebar.
For syntactic content assist, the editor proposes tokens and SQL templates that are valid within the current statement. The proposals provided are not based on a full grammar analysis of the current statement, in which only the tokens that are valid at the cursor location would be proposed. For database elements:
  • The editor provides proposals based on the database defined, the default schema property of the database connection, the current statement, and the cursor position.
  • If no database connection is active and you have specified the Start connections when needed preference setting, the proposals coming from the database information may not appear initially. After the connection is established, the proposals appear in subsequent content-assist requests.