VisualAge Generator to Enterprise Generation Language Migration Guide


Functions

The following tables compare the VAGen function part with the EGL function part and describe how the migration tool handles the conversion.

The functions section is organized into the following tables:

Note:
This release of EGL does not support web transactions, UI records, or a replacement for CONVERSE UI record. However, the EGL converse statement is expected to be the same for both a map and a UI record. The migration tool converts the CONVERSE I/O option without regard to whether the I/O object is a map or a UI record. This preserves as much of your logic as possible.

Figure 88. Functions -- general syntax, description, parameters, return value, and local storage

VisualAge Generator 4.5
EGL produced by the migration tool Migration tool considerations
Function parts can contain the following:
  • Function name
  • I/O option
  • I/O object
  • Properties:
    • Error routine
    • Description
  • Function return value
  • Function parameters
  • Function local storage
  • SQL statement
  • Statements before the I/O option
  • Statements after the I/O option
  • DL/I call
Function parts can contain the following:
  • functionName
  • functionParameterList
  • returnItemType
  • dataDeclarations
  • Statements before the I/O statement
  • I/O statement
  • Statements after the I/O Statements

An example of the format of a function invocation statement created by the migration tool is as follows:

// Description
Function functionName
  (functionParamterList)
  [ returns( returnItemType ) ]
    [ dataDeclarations ]
    [ beforeStatements ]
    [ I/O Statement ]
    [ afterStatements ]
end  //  end functionName 
Note:
  • The VAGen I/O option, I/O object, error routine, and SQL statement are used to create the EGL I/O statement.
  • DL/I call is not supported in this release.

The migration tool uses the I/O option, I/O object, and error routine to build the EGL I/O statement. See Figure 91

For details on how the migration tool handles the Description, Function return value, Function parameters, and Function local storage, see the following rows in this table.

See the following for details on the migration of before and after statements:

See the following for details on I/O options and error routines:

  • See Figure 89 for the EXECUTE I/O option.
  • See Figure 90 for I/O options for maps and UI records.
  • See Figure 91 for I/O error routine for records.
  • See Figure 92 for I/O options for serial, indexed, relative, and message queue records.

For details on SQL statements, see the following tables in this section:

  • See Figure 93 for I/O options for unmodified SQL statements.
  • See Figure 94 for I/O options for modified SQL statements without Execution Time Statement Build.
  • See Figure 95 for I/O options for SQL statements with Execution Time Statement Build.

Description Not applicable The migration tool converts the function description to a comment that precedes the Function definition.
Function parameters:
  • Function parameters are entered in a special window.
  • Items used as function parameters can be shared or nonshared. The definition for nonshared functions is stored in the function.
Function parameters:
  • Parameters must be separated by commas.
  • Each parameter has type information.
  • Optionally, each parameter has parameter type information.

An example of the format of function parameters is as follows:

( parameterName typeInfo 
     [ parameterType ]
   { , parameterName typeInfo
        [ parameterType ]  } )

A specific example of function parameters is as follows:

(parmSharedItem parmSharedItem 
   field,
 parmNonSharedItem char(10)
   nullable,
 parmRecord parmRecord)

Function parameters:

The migration tool sets the type information as follows:

  • For a record, the typeInfo is a type definition that specifies the same record name.
  • If the item type is one of the VAGen Any* types, the typeInfo is the corresponding EGL special item type.
  • If the item is a shared data item, then the typeInfo is the itemName used as a type definition.
  • If the item is a nonshared data item, then the typeInfo is migrated based on the item type, length, and decimals, and follows the rules described in Figure 61.

Function parameters:
  • Function parameter types:
    • Record
    • Item
    • Map item
    • SQL item
Function parameters:
  • Function parameter types:
    • Not applicable
    • Not applicable
    • field
    • nullable
Function parameters:
  • Special item types, length is not specified:
    • AnyChar
    • AnyDBCS
    • AnyMix
    • AnyHex
    • AnyUnicode
    • AnyNumeric
Function parameters:
  • Special item types, length is not specified:
    • char
    • dbchar
    • mbchar
    • hex
    • unicode
    • number
Function return value:
  • Data type
  • Length
  • Decimals
  • Description
EGL returns value:
  • The following is an example of the returns statement format:
  returns( returnItemType ) 
           // Description 
If the function includes a return value, the migration tool migrates the data type, length, and decimals based the rules described in Figure 61.
Function local storage:
  • Function local storage is entered in a special window.
  • Items used as function local storage can be shared or nonshared. The definition for nonshared items is stored in the function.
Function variable declarations:
  • Function variable declarations must include variable names and their associated type information.
  • An example of the format of function variable declarations is as follows:
    // Function Declarations
        variableName typeInfo  ;
      { variableName typeInfo  ;  }
    

Function local storage:

The migration tool sets the typeInfo as follows:

  • For a record, the typeInfo is a type definition that specifies the same record name.
  • If the item is a shared data item, then the typeInfo is the itemName used as a type definition.
  • If the item is a nonshared data item, then the typeInfo is migrated based on the item type, length, and decimals, and follows the rules described in Figure 61.

Function local storage:
  • Function local storage types:
    • Record
    • Item
Function local storage:
  • Function local storage types:
    • Not applicable
    • Not applicable

Figure 89. Functions -- EXECUTE I/O option

VisualAge Generator 4.5
EGL produced by the migration tool Migration tool considerations
  • I/O object: none
  • I/O option: EXECUTE

No equivalent statement. The migration tool eliminates the EXECUTE I/O option.

Figure 90. Functions -- I/O options for maps and UI records

VisualAge Generator 4.5
EGL produced by the migration tool Migration tool considerations
  • I/O object: mapName
  • I/O option: DISPLAY
Note:
DISPLAY is used for both display and printer maps.

To display a text form, use the display statement. To print a print form, use the print statement.

The following are examples of a display statement and a print statement:

display mapName;
 
print mapName;
Note:
In VisualAge Generator Compatibility mode, display printForm is treated as though it is print printForm.
The migration tool converts to the display or print statement based on the map type. See DISPLAY statement for maps for details and potential problems.
  • I/O object: mapName
  • I/O option: CONVERSE

Use the converse statement.

The following is an example of a converse statement:

converse mapName;
No special considerations.
  • I/O object: UIRecordName
  • I/O option: CONVERSE

Use the converse statement. The following is an example of a converse statement:
converse UIRecordName;
No special considerations.

Figure 91. Functions -- I/O for records -- general information and I/O error routine

VisualAge Generator 4.5
EGL produced by the migration tool Migration tool considerations
VAGen record I/O:
  • I/O option
  • I/O object (always a record)
  • I/O error routine (optional)
EGL record I/O:
  • An I/O statement
  • Record name
  • try onException end statement with error routine name (optional)

If an I/O error routine is specified, the statements are enclosed within a try...end block. An example of record I/O with an error routine is as follows:

try
    add recordName ;
    [onException  error-routine ; ]
end 
The migration tool does the following:
  • Changes the VAGen I/O option to the corresponding EGL I/O statement.
An error routine is optional for functions that do I/O for records.
Note:
The error routine is invoked if there is a soft error or if EZEFEC = 1.

An error routine is optional for functions that do I/O for records. An I/O example without an error routine is as follows:

add recordName;

An I/O example with an error routine is as follows:

try
    add recordName ;
    onException  error-routine ; 
end 
Note:
The onException statement is invoked if there is a soft error or if handleHardIOErrors = 1.
The migration tool does the following:
  • If the error-routine is not specified, the tool does not include the try, onException, or end statements.
  • If an error-routine is specified, the tool includes the try and end statements.
  • The migration tool converts to the onException statement based on the VAGen error routine name. When the migration tool migrates programs, it always migrates the VAGen main function names to both the main function label and the main function invocation statement. That way, when migrating a function's I/O error routine, the mainFunctionLabel is always the same as the mainFunctionName.

Special considerations apply for the migration of error routines that are function names. See Ambiguous situations for functions - File and database I/O error routines for details and potential problems.

Error routine values:
EZECLOS
EZEFLO
EZERTN
mainFunctionName
 
nonmainFunctionName
onException block statements:
onException exit program;
onException exit stack;
Omit the onException statement.
onException exit stack
     mainFunctionLabel;
onException 
     nonmainFunctionName();

Figure 92. Functions -- I/O options for serial, indexed, relative, and message queue records

VisualAge Generator 4.5
EGL produced by the migration tool Migration tool considerations
  • I/O object: recordName
  • I/O option: ADD

Use the add statement. The following is an example:

add recordName;
No special considerations.
  • I/O object: recordName
  • I/O option: SCAN

Use the get next statement. The following is an example:

get next recordName;
No special considerations.
  • I/O object: recordName
  • I/O option: SCANBACK

Use the get previous statement. The following is an example:

get previous recordName;
No special considerations.
  • I/O object: recordName
  • I/O option: CLOSE

Use the close statement. The following is an example:

close recordName;
No special considerations.
  • I/O object: recordName
  • I/O option: INQUIRY

Use the get statement. The following is an example:

get recordName;
No special considerations.
  • I/O object: recordName
  • I/O option: UPDATE

Use the get forUpdate statement. The following is an example:

get recordName forUpdate;
No special considerations.
  • I/O object: recordName
  • I/O option: DELETE

Use the delete statement. The following is an example:

delete recordName;
No special considerations.
  • I/O object: recordName
  • I/O option: REPLACE

Use the replace statement. The following is an example:

replace recordName;
No special considerations.

Figure 93. Functions -- I/O options for default (unmodified) SQL statements without Execution Time Statement Build)

VisualAge Generator 4.5
EGL produced by the migration tool Migration tool considerations
  • I/O object: recordName
  • I/O option: ADD

Use the add statement. The following is an example:

add recordName;
No special considerations.
  • I/O object: recordName
  • I/O option: SCAN

Use the get next statement. The following is an example:

get next recordName;
No special considerations.
  • I/O object: recordName
  • I/O option: CLOSE

Use the close statement. The following is an example:

close recordName;
No special considerations.
  • I/O object: recordName
  • I/O option: INQUIRY
(with and without Single row select)

Use the get statement. If you are doing a single row select, also use singleRow. An example without single row select is as follows::

get recordName;
 

An example with single row select is as follows:

get recordName singleRow;

If Single row select is specified in VisualAge Generator, the migration tool includes the EGL singleRow option.

  • I/O object: recordName
  • I/O option: UPDATE

Use the get forUpdate statement. The following is an example:

get recordName forUpdate 
    resultSetID;

The migration tool always includes the resultSetID when migrating an SQL UPDATE statement. The tool sets the resultSetID to the function name followed by a customer-specified suffix. You can control the suffix with the Stage 2 VAGen Migration Syntax Preferences.

Special considerations apply if the migration tool cannot determine if the record is SQL or non-SQL. See SQL I/O with multiple updates for details and potential problems.

  • I/O object: recordName
  • I/O option: DELETE

Use the delete statement. The following is an example:

delete recordName;
No special considerations.
  • I/O object: recordName
  • I/O option: REPLACE

(with or without UPDATE/SETUPD functionName

Use the replace statement. The following are some examples:

replace recordName;
 
replace recordName from 
        resultSetID;

If the UPDATE/SETUPD function name was included in VisualAge Generator, the migration tool includes the resultSetID and sets the resultSetID to the UPDATE/SETUPD function name followed by a customer-specified suffix. You can control the suffix with the Stage 2 VAGen Migration Syntax Preferences.

  • I/O object: recordName
  • I/O option: SETINQ

(with and without Declare cursor with hold)

Use the open statement. If you are doing a Declare cursor with hold, also use the hold option. The following are examples of both types of statement:

open resultSetID for recordName;
 
open resultSetID hold
   for recordName;

The migration tool sets the resultSetID to the function name followed by a customer-specified suffix. You can control the suffix with the Stage 2 VAGen Migration Syntax Preferences.

If Declare cursor with hold is selected in VisualAge Generator, the migration tool includes the EGL hold option.

  • I/O object: recordName
  • I/O option: SETUPD

(with and without Declare cursor with hold)

Use the open forUpdate statement. If you are doing a Declare cursor with hold, also use the hold option. The following are examples of both types of statement:

open resultSetID forUpdate
     for recordName;
 
open resultSetID hold forUpdate
     for recordName;

The tool sets the resultSetID to the function name followed by a customer-specified suffix. You can control the suffix with the Stage 2 VAGen Migration Syntax Preferences.

If Declare cursor with hold is selected in VisualAge Generator, the migration tool includes the EGL hold option.

  • I/O object: recordName
  • I/O option: SQLEXEC

with Model SQL Statement

Note:
  • The SQL record name is included in this form of SQLEXEC.
  • The values for the model type are:
    • None
    • Update
    • Delete
  • If the model type is None, VisualAge Generator does not do any I/O. Generation still processes the I/O error routine, but there will not be an error.

Use the execute statement. The following is an example:

execute modelType for recordName;
Note:
modelType is either update or delete.

The migration tool sets the EGL modelType based on the VAGen Model SQL Statement value.

If the VAGen Model SQL Statement is None, the migration tool omits the I/O statement because the VAGen I/O statement did not do anything. The migration tool includes the try, onException, and end statements based on the function's I/O error routine.


Figure 94. Functions -- I/O options for modified SQL statements, without Execution Time Statement Build

VisualAge Generator 4.5
EGL produced by the migration tool Migration tool considerations
General Information for modified SQL statements:
  • VisualAge Generator builds the table clause from the SQL row record at test and generation time. The table clauses are as follows:
    • insert into sqlTableName for the ADD I/O option
    • from sqlTableName sqlTableLabel for the INQUIRY, UPDATE, SETINQ, and SETUPD I/O options
    • update sqlTableName for the REPLACE I/O option
  • Depending on when the function was last modified, other SQL clauses might not be stored in the function definition. If the SQL clause is not stored, VisualAge Generator creates a default clause based on the record definition of the I/O object.
  • !itemColumnName variables are permitted. These variables specify the name of an item in the SQL row record. At test or generation time, VisualAge Generator substitutes the corresponding SQL column name.
  • sqlClauses are written in SQL syntax.
General Information for modified SQL statements:
  • If you need to modify any SQL clause, EGL requires that all clauses be explicitly specified. The table clause must be explicitly included in the SQL statement. The table clauses are as follows:
    • insert into sqlTableName for the add statement.
    • from sqlTableName sqlTableLabel for the get and open statements.
    • update sqlTableName for the replace statement.
  • EGL requires that all clauses be explicitly specified if any SQL clause is specified. The required SQL clauses vary with the type of I/O.
  • EGL requires that the SQL column names be explicitly included in the SQL statement. !itemColumnName variables are not supported.
  • sqlClauses are written in SQL syntax.

The migration tool uses the tables and table labels from the SQL row record to build the tables clause for the EGL I/O statement. Both table names and table name host variables are included in the table clause of the EGL I/O statement.

If a required SQL clause is not stored in the function definition, the migration tool creates a default clause based on the record definition in the same way as in VisualAge Generator.

The migration tool converts any !itemColumnName variables to their corresponding SQL column name.

The migration tool converts VAGen comments (/*) to SQL comments (--)

Special considerations apply if the SQL record and its alternate specification record, if any, are not available during migration. See Ambiguous situations for functions - SQL I/O for details and potential problems.

  • I/O object: recordName
  • I/O option: ADD

Clauses that can be modified:

  • Columns
  • VALUES

Use the add statement. The following is an example:

add recordName
  with #sql{
   insert into 
   sqlTablename 
   (columnName1, columnName2)
   values
   (valueInfo1, valueInfo2)
}; 
The migration tool creates the insert into clause based on the table name in the record definition. Special considerations apply. See Ambiguous situations for functions - SQL I/O for details and potential problems.

  • I/O object: recordName
  • I/O option: INQUIRY

(with and without Single row select)

Clauses that can be modified:

  • SELECT
  • INTO
  • WHERE, GROUP BY, HAVING
  • ORDER BY

Use the get statement.

The following is an example without single row select:

get recordName singleRow
    with #sql{
  select 
    Name1,
    Name2,
    Age
  from 
       sqlTable1 sqlLabel1, 
       sqlTable2 sqlLabel2 
  where 
       Name1 = :Namex
  order by
         Age
}
into 
 nameA, nameB, myage; 

If Single row select is specified in VisualAge Generator, the migration tool includes the EGL singleRow option.

The migration tool creates the from clause based on the table names and table labels in the record definition. Special considerations apply. See Ambiguous situations for functions - SQL I/O for details and potential problems.

  • I/O object: recordName
  • I/O option: UPDATE

Clauses that can be modified:

  • SELECT
  • INTO
  • WHERE
  • FOR UPDATE OF

Use the get forUpdate statement .

The following is an example:

get recordName forUpdate
 resultsetID
   with #sql{
     select
       Name1, Name2, Age
     from
       sqlTable1 sqlLabel1
     where
       Name1 = :Namex
     for update of
       Name2, Age
   }
   into
      Name1, Name2, Age; 

The migration tool always includes the resultSetID when migrating an UPDATE statement for an SQL record. The tool sets the resultSetID to the function name followed by a customer-specified suffix. You can control the suffix with the Stage 2 VAGen Migration Syntax Preferences.

The migration tool creates the from clause based on the table name or table label in the record definition. Special considerations apply. See Ambiguous situations for functions - SQL I/O for details and potential problems.

  • I/O object: recordName
  • I/O option: REPLACE

(optional UPDATE/SETUPD functionName)

Clause that can be modifed:

  • SET

Use the replace statement.

The following is an example of the replace statement:

replace recordName
 with #sql{
   update
     sqlTableName
   set
     columnName1 = value1,
     columnName2 = value2
 }
 from resultSetID; 

If an UPDATE/SETUPD function name is included in VisualAge Generator, the migration tool includes the from resultSetID clause. The migration tool sets the resultSetID to the UPDATE/SETUPD function name followed by a customer-specified suffix. You can control the suffix with the Stage 2 VAGen Migration Syntax Preferences.

The migration tool creates the update clause based on the table name in the record definition. Special considerations apply. See Ambiguous situations for functions - SQL I/O and SQL I/O and missing required SQL clauses for details and potential problems.

  • I/O object: recordName
  • I/O object: SETINQ

(with or without Declare cursor with hold)

  • I/O object: recordName
  • I/O object: SETINQ

(with or without Declare cursor with hold)

Clauses that can be modified:

  • SELECT
  • INTO
  • WHERE, GROUP BY, HAVING
  • ORDER BY

Use the open statement. If you are doing a Declare cursor with hold, also use the hold option.

The following is an example of an open statement using the hold option:

open resultSetID hold
 with #sql{
   select
     Name1, Name2
   from
     sqlTable1 sqlLabel1,
     sqlTable2 sqlLabel2
   where
     Name1 > :Name2
   order by
     Name1
 }
 into Name1, Name2
 for recordName; 

The tool sets the resultSetID to the function name followed by a customer-specified suffix. You can control the suffix with the Stage 2 VAGen Migration Syntax Preferences.

If Declare cursor with hold is selected in VisualAge Generator, the migration tool includes the EGL hold option after the resultSetID.

The migration tool creates the from clause based on the table names and table labels in the record definition. Special considerations apply. See Ambiguous situations for functions - SQL I/O for details and potential problems.

  • I/O object: record
  • I/O option: SETUPD

(with or without Declare cursor with hold)

Clauses that can be modified:

  • SELECT
  • INTO
  • WHERE
  • FOR UPDATE OF

Use the open forUpdate statement. The following is an example using the hold option:

open resultSetID hold forUpdate
 with #sql{
   select
     Column1, Column2
   from
     sqlTable1 sqlLabel1,
     sqlTable2 sqlLabel2
   where
     Column1 > :Item1
   for update of
     Column2
 }
 into Item1, Item2
 for recordName; 

The migration tool sets the resultSetID to the function name followed by a customer-specified suffix. You can control the suffix with the Stage 2 VAGen Migration Syntax Preferences.

If Declare cursor with hold is selected in VisualAge Generator, the migration tool includes the EGL hold option.

The migration tool creates the from clause based on the table name or table label in the record definition. Special considerations apply. See Ambiguous situations for functions - SQL I/O for details and potential problems.

  • I/O object: record
  • I/O option: SQLEXEC

with Model SQL Statement

Note:
  • The SQL record name is optional in this form of SQLEXEC.
  • The values for the model type are as follows:
    • None
    • Update
    • Delete

Use the execute sql statement. The following is an example of the statement:

execute modelType 
 #sql{
   UPDATE mysqltable
   set Column1 = Column1 * 2
   where Column2 = :Column2
 }
 for recordName; 
Note:
The values for model type include Update and Delete.

The migration tool does the following:

  • Converts SQLEXEC to the execute statement.
  • Uses the I/O object, if it is specified, as the recordName in the for clause.

The migration tool includes the VAGen Model SQL Statement value, if any, as a comment on the EGL execute statement.

The migration tool migrates the VAGen SQLEXEC clauses to EGL SQL clauses.


Figure 95. Functions - I/O options for modified SQL statements with Exection Time Statement Build

VisualAge Generator 4.5
EGL produced by the migration tool Migration tool considerations
Execution time statement build can only be used with the following I/O options:
  • INQUIRY
  • UPDATE
  • SETINQ
  • SETUPD
  • SQLEXEC

You specify Execution time statement build to cause VisualAge Generator to prepare the SQL statement dynamically every time the I/O statement is executed.

In EGL, you code the SQL prepare statement directly whenever you want the SQL statement to be dynamically prepared. You must also code the open, execute, or get statement that follows the prepare. For example, the EGL equivalent of a VAGen INQUIRY I/O option with Execution time statement build is as follows:
prepare prepID from
  "sqlStatementString"
  for recordName;
get recordName with prepID
  into itemList;
Note:
  • The sqlStatementString in the prepare statement is a concatenated string of constants and variables that is written in SQL notation. An example of a where clause that uses both column names and variable is as follows:
    [other clauses]
    + " where columnName = "
    + itemName
    + " AND columnName2 = "
    + itemName2
    + .... [other clauses]
    
  • The examples shown in the rest of this table do not include splitting the variables outside the double quotes.
The migration tool uses the SQL clauses in the function and the table names and /or table name variables in the record definition to build the sqlStatementString. The migration tool builds the sqlStatementString as follows:
  • Does all the processing as though the Execution time statement build were not specified, including the following:
    • Using the table names and / or table labels from the SQL row record to build the tables clause for the EGL I/O statement. Both table names and table name host variables are included in the tables clause of the EGL I/O statement.
    • Creating default clauses as necessary based on the record definition.
    • Converting any !itemColumnName variables to their corresponding SQL column name.
    • Converting VAGen comments (/*) to EGL comments (//) in the prepare statement.

Then the migration tool does additional processing to create the sqlStatementString, including:

  • Enclosing constants, column names and SQL operators in double quotes.
  • Placing variables outside double quotes.
  • Using the + string concatenation operator to concatenate the strings and variables together.

Special considerations apply if the SQL record and its alternate specification record, if any, are not available during migration. See Ambiguous situations for functions - SQL I/O and SQL I/O and missing required SQL clauses for details and potential problems.

  • I/O object: record
  • I/O option: INQUIRY

with and without Single row select

Clauses that can be modified:

  • SELECT
  • INTO
  • WHERE, GROUP BY, HAVING
  • ORDER BY

Use the prepare statement. The following is an example:
prepare prepID from
  " select columnName "
 + ", columnName2 "
 + " from table1 t1 "
 + "[ where whereClause ]"
 + "[order by orderByClause ]"
 [ for recordName ];
get recordname with prepID
  into itemList
No special considerations.

  • I/O object: record
  • I/O option: UPDATE

Clauses that can be modified:

  • SELECT
  • INTO
  • WHERE
  • FOR UPDATE OF

Use the prepare statement. The following is an example:
prepare prepID from
  " select columnName "
 + ", columnName2 "
 + " from table1 t1 "
 + "[ where whereClause ]"
 + " for Update of columnList "
 [ for recordName ];
 
get recordName forUpdate
  resultSetID
  with prepID
  into itemList;
The migration tool always includes the resultSetID when migrating an UPDATE statement for an SQL record. The tool sets the resultSetID to the function name followed by a customer-specified suffix. You can control the suffix with the Stage 2 VAGen Migration Syntax Preferences.

  • I/O object: record
  • I/O option: SETINQ

with or without Declare cursor with hold

Clauses that can be modified:

  • SELECT
  • INTO
  • WHERE, GROUP BY, HAVING
  • ORDER BY

Use the prepare statement. The following is an example:
prepare prepID from
  " select columnName "
 + ", columnName2 "
 + " from table1 t1 "
 + "[ where whereClause ]"
 + "[order by orderByClause ]"
 [ for recordName ];
open resultSetID [ hold ]
  with prepID
  into itemList
  [ for recordName ]; 

The migration tool sets the resultSetID to the function name followed by a customer-specified suffix. You can control the suffix with the Stage 2 VAGen Migration Syntax Preferences.

If Declare cursor with hold is selected in VisualAge Generator, the migration tool includes the EGL hold option after the resultSetID.

  • I/O object: record
  • I/O option: SETUPD

with or without Declare cursor with hold

Clauses that can be modified:

  • SELECT
  • INTO
  • WHERE
  • FOR UPDATE OF

Use the prepare statement. The following is an example:
prepare prepID from
  " select columnName "
 + ", columnName2 "
 + " from  table1 t1 "
 + "[ where whereClause ] "
 + " for update of columnList "
 [ for recordName ] ;
open resultSetID [ hold ]
 forUpdate
 with prepID
 into itemList
 [ for recordName ] 

The tool sets the resultSetID to the function name followed by a customer-specified suffix. You can control the suffix with the Stage 2 VAGen Migration Syntax Preferences.

If Declare cursor with hold is selected in VisualAge Generator, the migration tool includes the EGL hold option after the resultSetID.

  • I/O object: record
  • I/O option: SQLEXEC

with Model SQL Statement

Note:
  • The SQL record name is optional in this form of SQLEXEC.
  • The values for the model type are as follows:
    • None
    • Update
    • Delete
Use the prepare statement. The following is an example:
prepare prepID from
  " grant " + group_privileges
 + " on " + table_name
 + " to " + userid
 [ for recordName ] ;
execute prepID
 [ for recordName ] ;
 // model = type

The migration tool includes the VAGen Model SQL Statement value, if any, as a comment on the EGL execute statement.

The migration tool converts the VAGen SQLEXEC clauses to EGL SQL clauses.


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