Forms FAQ
From Oracle FAQ
Contents
■ 1 What is Oracle Forms and what is it used for?
■ 2 Can one convert/reverse engineer a FMX back to a FMB file?
■ 3 Can an Forms FMX be moved from one operating system to another?
■ 4 What tools can do a 'diff' to discover the differences between 2 versions of an FMB file?
■ 5 How does one iterate through items and records in a specified block?
■ 6 Can one bypass the Oracle login screen?
■ 7 Can one Maximize/ Minimize a Window in Forms?
■ 8 What is the difference between CALL_FORM, NEW_FORM and OPEN_FORM?
■ 9 How does one suppress or customize error messages in Forms?
■ 10 Can one issue DDL statements from Forms?
■ 11 Can one execute dynamic SQL from Forms?
■ 12 Forms won't allow me to use restricted built-in's. What should I do?
■ 13 Can one change the mouse pointer in Forms?
■ 14 Why doesn't my messages show on the screen?
■ 15 What happened to SQL*Menu?
■ 16 How does one create a custom toolbar?
■ 17 How does one compile MS Help files?
■ 18 How can I read/write OS Files from Forms?
■ 19 How can I generate all my forms in a batch?
■ 20 How does one get a form to run on Unix?
Oracle Forms is part of Oracle's Internet Developer Suite (iDS). Previous versions of it was called
SQL*Forms.
http://www.orafaq.com/wiki/Forms_FAQ 12/22/2010
Forms FAQ - Oracle FAQ Page 2 of 7
PS: You also need to regenerate the FMB files after upgrading to a new Forms version.
FORMS API Master -- This will help us to compare two Fmbs. in Tools Developer Compare option will be
there you can compare two fmbs.
How does one iterate through items and records in a specified block?
One can use NEXT_FIELD to iterate (loop) through items in a specific block and NEXT_RECORD to iterate
through records in a 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
-- ON-LOGON Trigger
declare
uname varchar2(10);
pass varchar2(10);
http://www.orafaq.com/wiki/Forms_FAQ 12/22/2010
Forms FAQ - Oracle FAQ Page 3 of 7
begin
uname := 'username';
pass := 'password';
logon(uname, pass || '@connect_database');
end;
Alternatively, edit the formsweb.cfg file located in ORACLE_HOME/forms/server creating a config like this:
[my_cfg]
userid=username/password@connect_database
form=MY_FORM.fmx
http://<<ip_address:port>>/forms/frmservlet?config=my_cfg
NEW_FORM: terminate the current form and replace it with the indicated new form. The old form's
resources (like cursors and locks) will be released.
OPEN_FORM: Opens the indicated new form without suspending or replacing the parent form.
MESSAGE_LEVEL:
Set to 0, 5, 10, 15, 20, 25 to suppress all messages with severity below this level. The default level is 0.
Messages with a level higher than 25 cannot be suppressed. See the "Forms Error Messages Manual" for more
details about the various MESSAGE_LEVEL's:
■ 0 - Default value. All types of messages from the other levels of severity.
■ 5 - Reaffirms an obvious condition.
http://www.orafaq.com/wiki/Forms_FAQ 12/22/2010
Forms FAQ - Oracle FAQ Page 4 of 7
Examples:
:SYSTEM.MESSAGE_LEVEL := '25';
COMMIT;
:SYSTEM.MESSAGE_LEVEL := '0';
However, you can use the FORMS_DDL built-in to execute DDL statements. Eg:
FORMS_DDL can also be used to create dynamic SQL statements at runtime. The FORMS_SUCCESS built-
in can be used to determine if the last executed built-in was successful.
Just note that FORMS_DDL will force an implicit COMMIT and may de-synchronize the Oracle Forms
COMMIT mechanism.
http://www.orafaq.com/wiki/Forms_FAQ 12/22/2010
Forms FAQ - Oracle FAQ Page 5 of 7
1. Create a TIMER at the point where you want the navigation to occur. Eg.
create_timer('TIMER_X', 5, NO_REPEAT);
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;
SET_APPLICATION_PROPERTY(CURSOR_STYLE, BUSY);
message('...'); synchronize;
This can also be used to execute a query while the user is looking at the results of a previous query.
http://www.orafaq.com/wiki/Forms_FAQ 12/22/2010
Forms FAQ - Oracle FAQ Page 6 of 7
■ 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).
Note: Designer/2000 includes a Help Generator that can generate source files for the Help Compiler.
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;
@echo off
@echo. +----------------------------------------------------------
http://www.orafaq.com/wiki/Forms_FAQ 12/22/2010
Forms FAQ - Oracle FAQ Page 7 of 7
@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.
@echo.
@echo Done!!! Remember to move the FMX files into your runtime directory.
@echo.
:END
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. Forms 6i uses commands f60gen, f60run, etc.
.:: Wiki Home :: Blogger Home :: Forum Home :: Contact :: Privacy ::.
http://www.orafaq.com/wiki/Forms_FAQ 12/22/2010