Oracle Forms 12c: Error 801 while compiling

If you’ve already upgrated to the latest Forms version (currently 12.2.1.2) you’ve maybe encountered following problem:
If you use a cursor, that is specified in a package specification within your forms and define a rowtype based on that cursor that is fetched into the rowtype in a different other part of the form (in my case the package body). If you then try to compile you may get the error 801 internal error [unexpected fragile external reference] from figure 1.

unbenannt

Figure 1: Compilation error

Metalink documents

We’ve opened a service request for that problem in metalink and received an answer, that I would like to show you in this blogpost. There is also a bug filed as well: Bug 23250870
The solution for the compilation error and it’s solution is described the following document in Metalink. It says, that the base bug is a PLSQL bug.
Rather than providing a patch for that problem, Oracle gives the information, that you have to set following variable to one to enable the compilation:

FORMS_PLSQL_BHVR_COMMON_SQL=1

If you set a path variable in CMD before starting the Forms Developer and then execute frmbld.exe you are able to compile a module that contains a construct like:

PACKAGE Test IS
  cursor c1 is select name_object from all_obj;
  master_rec            c1%ROWTYPE;
END;
Package body Test is  
  Procedure p1 is
  begin
      fetch c1 into master_rec;      
      close c1;
  end p1;    
end;  

 

Registry entry & environment variable

Warning: Changing the Windows registry can mess up your OS.

I’ve tried to also create a registry entry in a Windows machine under HKEY_LOCAL_MACHINE\Software\Oracle\KEY_OracleHome1 and set it to “1” so you don’t have to execute a batch before running Forms Builder. Also I have tried to create a new environment variable. Both options enable the Forms Builder to compile. But I had complications while compiling a bigger customer forms module, when I hit directly Ctrl+shift+k – the Forms Builder crashed when I did not connect to the database before hitting the hotkey.

OTN links

https://community.oracle.com/thread/3986558

https://community.oracle.com/message/13371977#13371977

Advertisements

2 thoughts on “Oracle Forms 12c: Error 801 while compiling

  1. Dear Daniel,
    In the example of package Test you could wonder why at all the cursor is defined in the package spec and not in the body. (persistence during the session? -> bulk collection)
    I ran into the same problem while compiling about 400 forms to upgrade from 11g to 12c.
    In our case the reason was that a package spec only contained a cursor definition and did not have a package body associated with it. The cursor definition in the spec was referenced in an other package body. Basic purpose was to separate the retrieval defintion from a very generic handling of the cursor data in the other package.
    What I did was evaluate the logic which was using the cursor and I moved this logic as procedures and functions into a new package body for package spec of the cursor. The cursor was also moved from the spec into the package body. The procedures/functions were then defined in the package spec where the cursor used to be.
    In this way a kind of an api is created around the cursor which can be called where the cursor used to be used.
    In our case this was not to much of a hassle …
    I can imagine however that there may be a reason for separaration of the cursor definition from the place where it is actually used which may have a lot more consequences.
    Hope this helps anyway.
    Greetings,
    Jan.

    Like

    • Hello Jan,
      thanks for your comment. I think the reason for the definition of the cursor in the package spec was reusability, but thank you anyway for your detailed explanation on how you’ve found a workaround.

      Greetings Daniel

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s