Resolving a reference to display an implicit SQL statement

Consider what happens when you specify the following EGL statement:
  open myRecord;

When the EGL editor tries to create a default SQL statement, the editor attempts to find a variable named myRecord and to identify the SQL record part on which that variable is based. If the variable is unavailable at development time or if the variable is undeclared, the editor attempts to use an SQL record part named myRecord as the basis for the default SQL statement. The editor assumes that you intend to create a variable whose name is the name of the SQL record part.

If you wish to store an SQL-related function in a file that does not include the variable myRecord, you can do as follows:
  1. In the program part, declare the global variable
  2. Create the function as a nested function in the program part
  3. Create the default SQL statement and modify it as appropriate; then, save the file
  4. Move the function to the other file

After the function is moved from the program part, the record name cannot be resolved at development time, and the editor cannot display any default SQL statements that are based on that record.

Related concepts
SQL support

Feedback
(C) Copyright IBM Corporation 2000, 2005. All Rights Reserved.