Index   Search   Add FAQ   Ask Question  

Oracle Forms 4.5/ 5.0/ 6.0 FAQ

$Date: 29-Jan-2000 $
$Revision: 1.31c $
$Author: Frank Naudé $

Topics

  • How does one iterate through items in a specified block?
  • Can one bypass the Oracle login screen?
  • Can one Maximize/ Minimize a Window in Forms?
  • Can one issue DDL statements from Forms?
  • Can one execute dynamic SQL from Forms?
  • Forms won't allow me to use restricted built-in's. What should I do?
  • Can one change the mouse pointer in Forms?
  • Why doesn't my messages show on the screen?
  • What happened to SQL*Menu?
  • How does one create a custom toolbar?
  • How does one compile MS Help files?
  • How can I read/write OS Files from Forms?
  • How can I generate all my forms in a batch?
  • Why do terminal users hate Forms?
  • How does one get a form to run on Unix?
  • Where can I get more info about Oracle Forms?

  • Back to Oracle FAQ Index

    How does one iterate through items in a specified block?

    Code example:
    OriPos := TO_NUMBER(:System.Trigger_Record);
    First_Record;
    
    LOOP
      --   do processing
      IF (:System.Last_Record = 'TRUE') THEN
         Go_Record(OriPos);
         EXIT;
      ELSE
         Next_Record;
      END IF;
    END LOOP
    
  • Back to top of file

  • Can on bypass the Oracle login screen?

    The first thing that the user sees when using runform is the Oracle logon prompt asking them for their username, password, and database to connect to. You can bypass this screen or customise it by displaying your own logon screen. Eg:

    ON-LOGIN

    declare
        uname varchar2(10);
        pass  varchar2(10);
    begin
        uname := 'username';
        pass  :='password';
        logon(uname, pass||'@connect_database');
    end;
    
  • Back to top of file

  • Can one Maximize/ Minimize a Window in Forms?

    On MS-Windows, Forms run inside a Windows Multiple-Document Interface (MDI) window. You can use SET_WINDOW_PROPERTY on the window called FORMS_MDI_WINDOW to resize this MDI (or any other named) window. Examples:
            set_window_property(FORMS_MDI_WINDOW, WINDOW_STATE, MINIMIZE);
            set_window_property(FORMS_MDI_WINDOW, POSITION, 7, 15);
            set_window_property('my_window_name', WINDOW_STATE, MAXIMIZE);
    
  • Back to top of file

  • Can one issue DDL statements from Forms?

    DDL (Data Definition Language) commands like CREATE, DROP and ALTER are not directly supported from Forms because your Forms are not suppose to manipulate the database structure.

    A statement like CREATE TABLE X (A DATE); will result in error:

    However, you can use the FORMS_DDL built-in to execute DDL statements. Eg:

  • Back to top of file

  • Can one execute dynamic SQL from Forms?

    Yes, use the FORMS_DDL built-in or call the DBMS_SQL database package from Forms. Eg:

    Just note that FORMS_DDL will force an implicit COMMIT and may de-synchronize the Oracle Forms COMMIT mechanism.

  • Back to top of file

  • Forms won't allow me to use restricted built-in's. What should I do?

    How to get around the "can't use a restricted built-in in built-in XXX" message:

    1. Create a TIMER at the point where you want the navigation to occur. Eg. create_timer('TIMER_X', 5, NO_REPEAT);

    2. Code a WHEN-TIMER-EXPIRED trigger to handle the navigation

    DECLARE
      tm_name  VARCHAR2(20);
    BEGIN
      tm_name  := Get_Application_Property(TIMER_NAME);
      IF tm_name = 'TIMER_X' THEN
        Go_Item('ITEM_X');
      END IF;
    END;

    Dirty but effective (didn't Oracle promise to fix this feature?).

  • Back to top of file

  • Can one change the mouse pointer in Forms?

    The SET_APPLICATION_PROPERTY build-in in Oracle Forms allow one to change the mouse pointer. Eg:

    SET_APPLICATION_PROPERTY(CURSOR_STYLE, BUSY);

  • Back to top of file

  • Why doesn't my messages show on the screen?

    Regardless of whether you call the MESSAGE() built-in with ACKNOWLEDGE, NO_ACKNOWLEDGE, or with no mode specification at all, your message may or may not be displayed. This is because messages are displayed asynchronously. To display messages immediately, use the SYNCHRONIZE build-in:

    message('...'); synchronize;

    This can also be used to execute a query while the user is looking at the results of a previous query.

  • Back to top of file

  • What happened to SQL*Menu?

    From Forms V4.5, SQL*Menu is fully integrated into Oracle Forms. Application menus can be added to your application by creating Menu Modules (*.MMB) and generate it to Menu Module Executables (*.MMX).

  • Back to top of file

  • How does one create a custom toolbar?

    Create a new block, let's name it "TOOLBAR" and a canvas named "C_TOOLBAR" (for ilustration purposes). Put some iconic buttons on your canvas. Use the following properties for these buttons:

  • Enabled: True
  • Navigable: False
  • Mouse Navigate: False

    Now set the "Canvas Type" in the canvas property palette to "Horizontal Toolbar" and the "Form Horizontal Toolbar Canvas" in the module property palette to your canvas name (C_TOOLBAR in our case).

  • Back to top of file

  • How does one compile MS Help files?

    The Microsoft Help Compiler does not ship with Designer/2000 or Developer/2000, but you can download it from here: Note: Designer/2000 includes a Help Generator that can generate source files for the Help Compiler.

  • Back to top of file

  • How can I read/write OS Files from Forms?

    OS files can be read/written from Forms using the TEXT_IO package in Forms. The TEXT_IO package has a datatype FILE_HANDLE. It also has procedures FCLOSE, GET_LINE, NEW_LINE, PUT, PUT_LINE & PUTF and a function FOPEN. Example:
            DECLARE
               file1  TEXT_IO.FILE_TYPE;
               file2  TEXT_IO.FILE_TYPE;
               str    VARCHAR2(80);
            BEGIN
               file1 := TEXT_IO.FOPEN( 'input.txt','r' );
               file2 := TEXT_IO.FOPEN( 'output.txt', 'w' );
               TEXT_IO.GET_LINE( file1, str );
               TEXT_IO.PUT_LINE( file2, str );
               TEXT_IO.FCLOSE( file1 );
               TEXT_IO.FCLOSE( file2 );
            END;
    
  • Back to top of file

  • How can I generate all my forms in a batch?

    @echo off
    @echo. +----------------------------------------------------------
    @echo. | FMXGNALL.BAT
    @echo. +----------------------------------------------------------
    @echo. |
    @echo. | Create runtime FMXs from source FMBs
    @echo. | Will convert ALL of the fmbs in the current direcotry
    @echo. | Usage : FMXALL.BAT username/password@connect string
    @echo. |
    @echo. +----------------------------------------------------------
    @echo.
    @echo. Username/Password@connect_string = %1
    @echo.
    
    IF %1 == "" GOTO END
    
    @echo Removing old FMX files
    del *.fmx
    
    @echo Creating the new FMX files
    rem Change f45gen32 to f45gen if in 16 bit environment.
    FOR %%F in (*.fmb) DO start /w f45gen32 userid=%1 batch=y module=%%F
    
    @echo.
    @echo Done!!! Remember to move the FMX files into your runtime directory.
    @echo.
    
    :END
    
  • Back to top of file

  • How does one get a form to run on Unix?

    You need to design your form on your workstation. FTP or copy the Forms's FMB file to the Unix box. If you generate for a terminal environment (character based), the syntax is:
       f45gen USERID=userid/passwd@db_name MODULE_TYPE=FORM MODULE=module_name
    
    If you want to generate a Library file, replace FORM with LIBRARY. Use f45genm to generate your form in a Motif environment.

    Use the "f45run" command to run your form.

  • Back to top of file

  • Why do terminal users hate Forms?

    Most Unix, MVS and VMS users do not like Forms 4.5/ 5.0 for a couple of reasons:

    I think Oracle should bring SQL*Forms v3.0 back for terminal users. They could rename the product to Oracle Forms for Terminals, or something.

  • Back to top of file

  • Where can I get more info about Oracle Forms?

  • Back to top of file

  • General: Home | Index | Preamble | Glossary | OraCorp | Papers | Fun | News | Events | Y2000 | Books | Links | Forums
    Products: SQL | Plus | Loader | PL/SQL | PreComp | OPO | OMO | OO4OLE | DBA | PQO | PSO | OCO | Net | ODBC | WebServer | Des2k | Dev2k
    Systems: MVS | Unix | Windows | WindowsNT | NetWare | VMS