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
Setting editor preferencestopic. If you want to use a nondefault database, do one of the following tasks before you use content assist:
- For a z/OS UNIX or local file in a subproject, specify in the CPP options in the Editor Options set of the target environment the database used by the C/C++ parser. For more information on target environments and the Editor Options set, see the following topics:
- For an MVS™ file, you can specify in a property group a Db2 z/OS database, and then you need to associate the property group with the data set or the MVS subproject that contains the source file that you are editing. For more information about property groups, see the following topics:
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
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.