Setting preferences for SQL retrieve

At EGL declaration time, you can use the SQL retrieve feature to create an SQL record from the columns of an SQL table.

To set preferences for the SQL retrieve feature:
  1. Click Window > Preferences, expand EGL, and then click SQL
  2. Specify the rules for creating each record field that the SQL retrieve feature creates:
    1. Specify the EGL type to use when creating a record field from an SQL character data type:
      • Use EGL type string (the default) maps SQL char data types to EGL string data types.
      • Use EGL type limited-length string maps SQL char data types to EGL limited-length string data types.
      • Use EGL type char maps SQL char data types to EGL char data types.
      • Use EGL type mbChar maps SQL char data types to EGL mbChar data types.
      • Use EGL type Unicode maps SQL char data types to EGL Unicode data types.
    2. Specify the EGL type to use when creating a record field from an SQL national character data type:
      • Use EGL type dbChar (the default) maps the SQL type to EGL dbChar data types.
      • Use EGL type Unicode maps the SQL type to EGL Unicode data types.
      • Use EGL type string maps the SQL type to EGL string data types.
      • Use EGL type limited-length string maps the SQL type to EGL limited-length string data types.
    3. Specify the case of the record field name:
      • Do not change case (the default) means that the case of the record field name is the same as the case of the related table column name.
      • Change to lower case means that the record field name is a lowercase version of the table column name.
      • Change to lower case and capitalize first letter after underscore also means that the record field name is a lowercase version of the table column name, except that a letter in the record field name is rendered in uppercase if, in the table column name, the letter immediately follows an underscore.
      • Change to lower case and capitalize first letter and first letter after underscore also means that the record field name is a lowercase version of the table column name, except that a letter in the record field name is rendered in uppercase if, in the table column name, the letter immediately follows an underscore. The first letter of the field name will also be rendered in uppercase.
    4. Specify how the underscores in the table column name are reflected in the record field name:
      • Do not change underscores (the default) means that underscores in the table column name are included in the record field name.
      • Remove underscores means that underscores in the table column name are not included in the record field name.
  3. Specify which data types are specified for the EGL fields that correspond to SQL date, time, and timestamp columns:
    • Use EGL date, time, and timestamp is the default.
    • Use EGL type char causes the EGL SQL retrieve process to work as it did in VisualAge® Generator, which did not have date/time primitive data types. Instead, VisualAge Generator used CHAR(10) for date, CHAR(8) for time, and CHAR(26) for timestamp.
    • Use EGL type Unicode uses EGL UNICODE fields.
    • Use EGL type string uses EGL STRING fields.
    • Use EGL type limited-length string uses EGL STRING fields that include a limiting value: 10 for date, 8 for time, and 26 for timestamp.

    If you convert SQL calendar variables to EGL character variables, you can select Set sqlDataCode on char, Unicode, and string fields to assign the sqlDataCode property to the EGL fields. This property indicates the type of the SQL source column, such as 385 to indicate date. Java™ generation uses this information when formatting the value of the field for print or display. COBOL generation does not currently use this information.

  4. If you want new SQL records to be compatible with COBOL programs (that is, to have fixed records with level numbers for structure items, and to use CHAR instead of STRING primitive types), select Add level numbers to record definition.
  5. If you want new SQL records to have the key field property set, select Retrieve primary key information from the system catalog.
  6. If you want to be prompted for a database password if you did not supply one for the connection on the SQL Database Connections page, select Prompt for SQL user ID and password when needed.
  7. If you want to clear the SQL credentials that have been remembered for this workspace session, click Clear Temporary Credentials.
  8. To save the changes and remain in the Preferences window, click Apply. To save the changes and exit the window, click OK.