Writing a User Exit in UNIX
The USER_EXIT directory is not available when you install Oracle Developer
Suite on UNIX. Starting with Oracle9i Forms, the demo user exit is
not shipped. However, the makefiles are available in <ORACLE_HOME>/forms/lib.
Youll have to copy the following files from the Forms 6i <ORACLE_HOME>/forms60/USEREXIT
directory:
- UE.H: Header file with definitions; do
not change.
- UE_SAMP.H: Header file with prototype
of the user exit function.
- UE_SAMP.PC: The code of the demo user
exit; you can use this as a template for your own user exits.
- UE_XTB.C: This file holds the table of
user exits.
To create a user exit in UNIX, do the following:
- Precompile and compile the user exit code as follows:
proc ue_samp.pc
cc -c ue_samp.c
- Compile the file ue_xtb.c which holds the table of user exits:
cc -c ue_xtb.c
- Relink the Forms executables with user exit:
make -f ins_forms.mk frmwebmx EXITS="ue_xtb.o ue_samp.o"
The makefile assumes that your user exit source code is in UE_SAMP.PC.
If your file has a different name, you can either change the makefile (line
EXITS=ue_xtb.o ue_samp.o) or pass the file names on the command line. For
example:
make -f ins_forms.mk frmwebmx EXITS="ue_xtb.o myexit.o"
- After creating frmwebmx, you should specify a Listener Servlet initialization
parameter in the web.xml file.
- Create a form to test your user exit. The demo user exit adds two items,
BLOCK1.ITEM1 and BLOCK1.ITEM2,
and puts the result into BLOCK1.ITEM3.
- Create a form called ue_samp.fmb with a non-basetable block called BLOCK1,
and three text items ITEM1, ITEM2
and ITEM3.
- Create a button with a WHEN-BUTTON-PRESSED trigger with the following code:
user_exit('UE_SAMP');
The test form does not need a connection to the database.
- Create an ON_LOGON trigger on form level with the following code:
null;
- Save and generate the form.
RESTRICTIONS: The required version of the pre-compiler to
use must match the Required Support Files (RSF) version of Forms. Pro*C 9.0.1
is bundled with Oracle Developer Suite 10g. If you encounter FRM-40800,
try renaming frmwebmx to frmweb.
Related topics
About the User Exit Interface