How to read the PL/SQL code in an Oracle Forms .FMT file?

Aurelio Martin Massoni picture Aurelio Martin Massoni · Oct 23, 2008 · Viewed 21.6k times · Source

Oracle Forms10g provides a tool to convert the Oracle Forms modules, from the binary format (.FMB) that Oracle Forms Builder works with, to text format (.FMT).

For example, if you create a module called mymodule.fmb with Oracle Forms Builder, and then invoke

frmcmp module=mymodule.fmb script=yes batch=yes logon=no

from the command line, the Oracle Forms Convert utility will create a file named mymodule.fmt from the file mymodule.fmb. This text file is supposed to be "readable" by humans, except for the PL/SQL code of triggers and program units, which is codified.

For example, this is a snippet of a .FMT file with a chunk of codified PL/SQL code

DEFINE  F50P
BEGIN
   PP = 10
   PI = 3
   PN = 464
   PL = 1138
   PV = (BLONG)
<<"
00000049 00800000 00440000 00000000 00000031 0000000d 00000002 a0011519 
00002420 0000045e 001f0000 00165030 5f32335f 4f43545f 32303038 31365f33 
375f3039 00000006 42454749 4e0a0000 0042676f 5f626c6f 636b2820 27504149 
53455327 20293b0a 69662066 6f726d5f 73756363 65737320 7468656e 0a096578 
65637574 655f7175 6572793b 0a656e64 2069663b 00000005 0a454e44 3b000000 
1d574845 4e2d4e45 572d464f 524d2d49 4e535441 4e434520 28466f72 6d290000 

Have you ever tried to decode this kind of files, to be able to extract the PL/SQL code of a form ?

It would be very useful to be able to search a string in the PL/SQL code of a lot of .FMT files, instead of using Oracle Forms Builder to manually open each of the corresponding .FMB files, and search the string in each one of them.

Thanks!

Answer

Jim Hudson picture Jim Hudson · Oct 24, 2008

Along with the API, note that if you're working at the start of this process you'll probably be better off generating the XML version than the FMT version. The FMT is an older format kept for backward compatibility, and tools like the recently announced Forms -> Oracle APEX converter will want the XML. It's also easier to read.

In "Forms 10g release 1" (9.0.4) the XML converter is a separate command line program. forms2xml. I think that's still true for 10.1

Plus, the XML is easier to read and interpret.