VisualAge Generator to Enterprise Generation Language Migration Guide

SQL I/O with multiple updates

VisualAge Generator: For SQL I/O, if there are multiple UPDATE or SETUPD functions in a program, each SQL REPLACE function must specify the name of its corresponding UPDATE or SETUPD function. This is not required for non-SQL I/O. SETUPD is not supported for non-SQL I/O.

EGL: For SQL I/O, if there are multiple get for update or open for update statements, each SQL replace statement must specify the name of its corresponding get or open statement. Each get and open statement specifies a resultSetID. The replace statement specifies the resultSetID for the corresponding get or open statement. The resultSetID is not applicable for non-SQL I/O.

Associated part needed for migration: The record that is the I/O object.

Figure 39. Ambiguous situations for functions--SQL I/O with multiple updates

Migrating with the associated part
Migrating without the associated part
Based on the first migration of this function, if the record is available, the migration tool creates the corresponding EGL statement(s) based on the record type.

For SQL, the migration tool does the following:

  • Always includes a resultSetID when migrating any UPDATE or SETUPD function. The resultSetID is created using the function name and a user-specified suffix.
  • Includes the resultSetID when migrating any REPLACE function that specified a corresponding UPDATE or SETUPD function name. The resultSeID is created using the corresponding UPDATE or SETUPD function name and a user-specified suffix.

For non-SQL, the migration tool always omits the resultSetID when migrating an UPDATE function. There are no SETUPD functions for non-SQL I/O.

When migrating an UPDATE function, if the record is not available, the migration tool does the following:
  • Attempts to determine if this function is for SQL I/O by checking if the function also has SQL clauses or any SQL-specific information such as Execution Time Statement Build, single row select, or cursor with hold.
  • If the migration tool can determine that this UPDATE statement is for an SQL record, the migration tool includes the resultSetID in the get statement.
  • Otherwise, the migration tool does not include the resultSetID. The migration tool issues a warning message.

When migrating a SETUPD function, the migration tool always includes the resultSetID because SETUPD is only valid for SQL.

When migrating a REPLACE function, the migration tool includes the resultSetID if the function specifies a corresponding UPDATE or SETUPD function name.

Potential Problem: None.

Potential Problem: A problem only arises if an unmodified UPDATE function really does refer to an SQL record and is used in a program where there are multiple get or open for update statements. In this case, each replace statement will include a resultSetID, but the get statement that was migrated for the VAGen UPDATE statement will not include the resultSetID. Preprocessing for the program will fail.

Solution: Modify the function to include the resultSetID for the get statement.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]