Document-ID:        16134.1
Subject:            (V4/V45) UPGRADING MENU APPLICATIONS
Author:             GKAMINAG
Last Modified Date: 24 December  1996


                         Upgrading Menu Applications
                         ===========================

Introduction
------------
    The process for upgrading menus from SQL*Menu 5.0 to Oracle Forms 4.0, or
from V4.0 to V4.5, is different from the process of upgrading forms.  This
bulletin provides a step-by-step guide for upgrading menu applications, and
also includes a debugging guide to assist troubleshooting.

Upgrading from SQL*Menu 5.0
---------------------------
    The Oracle Forms Generator is the workhorse of the upgrading process, just
as it is when upgrading forms.  When upgrading forms, the generator performs a
file-to-file conversion, parsing one file (.INP) while creating another (.FMB).
SQL*Menu 5.0 modules, however, are stored completely in the database -- there
are no source files for the generator to operate upon.  (DMM files are compiled
versions of the menu, more analogous to the non-readable .FRM file)  Thus, when
upgrading menus, the generator does a base table to base table conversion.
    Knowing this, there are two obvious prerequisites to check before starting
the upgrade process:

    * Both sets of base tables must be installed in the same database.

      To check this:
         1. Log into the database through SQL*Plus as SYSTEM

         2. DESC MENU_B_APPL
            If the description does not come back, or if you see CHAR datatypes
            for some columns, you need to install the SQL*Menu 5.0 base tables.
            Please refer to bulletin 107368.716 "INSTALLING MENU 5.0 BASE
            TABLES"  Note that verifying the existence of MENU_B_APPL
            is only a cursory check.  Review bulletin 107368.716 for a
            full check of all menu items.

         3. DESC FRM40__APP
            Again, make sure the description comes back.  If this fails
            with ORA-942, reinstall the Oracle Forms base tables.  Please
            refer to bulletin 106690.304 "(V4) How to Install Base Tables
            for Oracle Forms 4.0"

       Forms V4.5 users should replace step 3 above with:

         3. DESC FRM45__OBJECT
            If this fails with ORA_942, reinstall the Oracle Forms V4.5
            tables.  Please refer to bulletin 108383.767 "Install Base
            Tables for Developer 2000 Tools"

$ORACLE_HOME/forms45/doc/relnotes.doc
The Developer 2000 release notes states the following:

5.4.  Upgrading SQL*Menu 5.0 Apps Directly to 4.5
        The upgrade of SQL*Menu 5.0 applications requires that the
        Forms 4.0 base tables are installed.  If you do not already
        have the base tables for Forms 4.0 installed, you will need
        to follow the instructions in this section.
        You will find the SQL scripts which install the Forms 4.0
        base tables in the FORMS45\SQL directory under ORAWIN.
        The base tables should be created in the SYSTEM account.  To
        migrate your SQL*Menu 5.0 application, you will need to run
        the following scripts within SQL*Plus as the SYSTEM user
                SQL> @frm4bild.sql
        Once you have upgraded your SQL*Menu 5.0 application, you can
        drop the Forms 4.0 base tables using the following script as
        the SYSTEM user :
                SQL> @frm4drop.sql
        Before running this script, you *must check* with your DBA
        that no one else is using the Forms 4.0 base tables.
        Otherwise, you may destroy other applications.
        When you perform the menu upgrade, make sure that you
        specify VERSION=50 from the command line or place the value
        '50' in the 'Version to Upgrade:' box in the generator
        options.

    * Menu modules should be stored in the database.
      To check this:

         1. Log into the database through SQL*Plus as SYSTEM

         2. SELECT * FROM MENU_B_APPL WHERE APPLICATION_NAME='MYAPPNAME';
            In the SQL above, MYAPPNAME refers to the name of your
            menu application.  Make sure a row comes back -- this will
            verify that your menus exist.

For Customers on ORACLE V6
--------------------------
    Many customers are simultaneously upgrading to ORACLE 7 as they are
upgrading their forms.  In that case, the menus will be on an ORACLE 6
database.  Before the menu modules can be upgraded, the following must be done:

    1. Unload all menu applications to be upgraded.  (This can be done
       through SQL*Menu, using the Action -> Unload menu option)  This
       will produce .SQL scripts for porting the menu to v7.

    2. Install the SQL*Menu base tables in the ORACLE 7 instance (see
       bulletin 107368.716 "INSTALLING MENU 5.0 BASE TABLES"

    3. As SYSTEM, run each .SQL script produced by step 1 against the
       V7 database.  This three steps move the menu modules from V5 tables
       on a V6 database to V5 tables on a V7 database.

How to Upgrade Menus from SQL*Menu 5.0
--------------------------------------
    Upgrading menus is done through the Oracle Forms Generator.  To invoke the
generator,  either double-click on the icon or, in UNIX, use F40GENM (or
F45GENM for V4.5 users).  This brings up the generator dialog box.  For a
default upgrade of menus, set the following properties:

    File:                  Name of the menu module in the database.  Not
                           case-sensitive.
    Username, etc.:        Your username, password, connect string
    Logon to the Database: ON
    Module Type:           Menu
    Module Access:         Database
    Upgrade 3.0 Form...:   ON
    Upgrade 5.0 Role...:   OFF

The rest leave as the default value.  With these values set, click OK on the
dialog and the menu upgrade should begin, with periodic dialogs informing you
of its progress.  NOTE: if you receive an error invoking F40GEN or during the
upgrade, refer to the troubleshooting section below.

    Alternatively, the generator can be called from the command line with all
the options specified:

    F40GEN MODULE=<name> USERID=<un/pw> MODULE_TYPE=MENU MODULE_ACCESS=DATABASE
    UPGRADE=YES

Upgrading from Oracle Forms 4.0 to Oracle Forms 4.5
---------------------------------------------------
    The upgrade path from Oracle Forms 4.0 to Oracle Forms 4.5 is relatively
painless.  For individual menu applications, simply open the V4.0 .MMB file in
Oracle Forms 4.5 and save it again.  Now the file will be a V4.5 file.
Note that this process is irreversible.  The menu module will no longer be
openable in V4.0.
    Another option is to use the Oracle Forms 4.5 generator with the following
options:

    File:                  Name of the .MMB file.  Wildcards are not accepted.
    Username, etc.:        Your username, password, connect string
    Module Type:           Menu
    Module Access:         File
    Upgrade 3.0 Form...:   OFF

Or, in batch mode:

    f45gen  module=mymmb  userid=scott/tiger  module_type=menu  batch=YES

Role Upgrading from SQL*Menu 5.0
--------------------------------
    To upgrade your menu V5.0 roles to Oracle Forms, use the following
generator settings:

    File:                  Blank
    Username, etc.:        Your username, password, connect string
    Module Type:           Menu
    Module Access:         Database
    Upgrade 3.0 Form...:   OFF
    Upgrade 5.0 Roles...:  ON

Or, in batch mode:

    f40gen  userid=scott/tiger  module_type=menu  upgrade_roles=YES

NOTE: earlier versions of Oracle Forms required a menu module to be upgraded
when upgrading roles, so in versions earlier that V4.0.13, you need to supply
a module name to upgrade and the Upgrade 3.0 Form flag to ON.

    To upgrade V5.0 roles to ORACLE7 roles for use in forms V4.5, use the
following generator settings:

    File:                  Blank
    Username, etc.:        Your username, password, connect string
    Module Type:           Menu
    Module Access:         Database
    Upgrade 3.0 Form...:   OFF
    Upgrade 5.0 Roles...:  ON
    Version:               50

Or, in batch mode:

    f45gen userid=scott/tiger  module_type=menu  upgrade_roles=YES  version=50

Role Upgrading from Oracle Forms 4.0
------------------------------------
    A big change in functionality from V4.0 to V4.5 is the integration of
version 7 roles to menu security.  In the past, menus relied on custom roles
for security, all maintained in the base tables.  With version 4.5, however,
ORACLE 7 roles can be used.  To upgrade the V4.0 roles to ORACLE 7 roles,
you can run the script FRM45ROL.SQL as SYSTEM in SQL*Plus.  This script is
located in C:\ORAWIN\FORMS45\SQL on Windows, $ORACLE_HOME/forms45/admin/sql
on UNIX, and oracle:scripts:cde: on Mac.
    The script itself is rather complicated.  Essentially, it is a PL/SQL
script which walks through the Oracle Forms 4.0 base tables and builds
a SQL script to insert this information into the ORACLE7 data dictionary
tables.  Because this builds and runs another script, you will need operating
system write access to the working directory of SQL*Plus.

Batch Upgrading
---------------
    To upgrade many V5.0 menus at once, the generator can be passed a wildcard
as the module name.  Passing module name as A% for instance, will upgrade all
menus whose names begin with A -- regardless of owner.  Thus, to upgrade ALL
menu modules to Oracle Forms, set the module name as %.
    Unfortunately, file to file conversion does not take wildcards.  To convert
a large number of V4.0 menus to V4.5 menus, you will need to run the generator
multiple times, or, if the platform supports it, create an operating system
shell script with several generation commands.

Troubleshooting
---------------

Q.  I am trying to run the f40gen program, and I am getting
    FRM-91500: Unable to start/complete the generation

A.  If you are using f40genm, then check that your DISPLAY variable is
    set and that your X windows system is running properly.  If you are
    using f40gen, then check your TERM and ORACLE_TERM environment
    variable settings.  For in-depth assistance, contact Oracle Support's
    Product Line groups (choose the options from the phone menu which
    ask you if you have an installation or operating-system related question)

Q.  I am trying to upgrade a SQL*Menu 5.0 menu to an Oracle Forms module
    and I am getting MNU-10637: Error performing upgrade.  (also comes up
    as FRM-10637, FRM-31637)

A.  This is a generic error which comes up when converting SQL*Menu V5.0
    applications to Oracle Forms V4.0.  If this is all that comes up, then
    most likely the SQL*Menu V5.0 base tables and the Oracle Forms V4.0
    base tables are not both available on the same database.  (See
    Upgrading from SQL*Menu 5.0, above)
    This is the most common error.  Other things to check:

         * Is the application you are trying to convert stored in the
           SQL*Menu base tables?  Run the following SQL in SQL*Plus
           and make sure a row comes back:

           SELECT * FROM MENU_B_APPL WHERE APPLICATION_NAME LIKE 'MYAPP';

         * Are your SQL*Menu V5.0 base tables CHAR type?  Describe
           the MENU_B_APPL table to make sure.

         * Do you have ample tablespace and rollback segment in the
           database?  Go into the Oracle Forms designer and create and save a
           new menu application to the database.  Make sure there is no problem
           inserting to the forms base tables.

         * Is there already an Oracle Forms application with that name?
           If so, the generator will not be able to convert this menu app.
           You will most likely have to rename the existing menu app.

Q.  I am trying to run my converted menu application, and when I select the
    menu choice to call another form, I get FRM-10242: Cannot call linked-in
    Oracle Forms from Oracle Forms

A.  This is something that comes up a lot in converted applications.
    In SQL*Menu V5.0, most application architectures were such that the user
    ran a menu, which then called forms (as type 4 commands).  However, in
    Oracle Forms, the emphasis is on the form, so the user will run a
    form which attaches to a menu.
      The problem is that when the form comes across a converted type 4
    command, it tries to execute the linked-in forms code.  Since this is
    already forms, there is no linked-in forms code, so it raises an error.
      To alleviate the problem, convert the type 4 (now called Oracle Forms
    type) commands to PL/SQL commands, and change the command lines from
    runform30...  to CALL_FORM('formname');

Q.  (MS Windows Only)  I am trying to run SQL*Plus from my menu item, but when
    I select it, the screen flashes and nothing happens.

A.  This happens a lot when upgrading SQL*Menu V5.0 applications.
    Change the code for the SQL*Plus invokation from  "sqlplus scott/tiger"
    to "plus31 scott/tiger".
      Oracle Forms Menu will interpret SQL*Plus invokations as OS commands.
    This is true if you call SQL*Plus from a PL/SQL menu item through a HOST
    command or even if you use the SQL*Plus menu item type.  Forms thus
    treats it like any other OS command -- it submits it to Windows to
    see if it is a windows command, then, if it fails there, it submits it
    to DOS.  So, Oracle Forms first tries to run a windows program called
    SQLPLUS, fails (since the executable is called PLUS31), then goes to
    DOS and tries there (and fails there).  This is what causes the flash --
    as usual, the screen is blanked when Windows goes to DOS.

Q.  I am upgrading SQL*Menu 5.0 menus to Oracle Forms 4.5 menus and am
    receiving FRM-10043 "Cannot Open File" using f45gen.

A.  Make sure Version to Upgrade = 50 is specified in addition to
    "Upgrade 3.0 Form, 5.0 Menu ..." when using f45gen.