Oracle Forms 4.5/ 5.0/ 6.0 FAQ

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

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;

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);
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:
Encountered the symbol "CREATE" which is a reserved word.
However, you can use the FORMS_DDL built-in to execute DDL statements. Eg:
FORMS_DDL('CREATE TABLE X (A DATE)');

Can one execute dynamic SQL from Forms?
Yes, use the FORMS_DDL built-in or call the DBMS_SQL database package from Forms. Eg:
FORMS_DDL('INSERT INTO X VALUES (' || col_list || ')');
Just note that FORMS_DDL will force an implicit COMMIT and may de-synchronize the Oracle Forms COMMIT mechanism.
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-TIM

No comments: