A script-enabled browser is required for this page to function properly.

Calling Library Program Units

After you create a library and attach it to the desired module, you can call library program units from that module using the same syntax you would use if the program units were defined locally. For example, to call a procedure named color_current_record in an attached library, you would simply write the name of the procedure in your form trigger:

color_current_record;

To refer to the contents of a library package, use standard PL/SQL dot notation, as shown here:

package_name.object

When Oracle Forms encounters a call to a program unit, it first looks for the program unit in the current module, then searches the attached libraries.

When you attach more than one library to the same module, you can specify the default library search order by sequentially ordering your library attachments in the Object Navigator.

Example

The following example shows you how to reference a data block in a library program unit:

At compile time, Oracle Forms will attempt to resolve all references to objects. Therefore, if you have code thus:

:BLOCK1.ITEM1 := 'Value';
or
IF
:BLOCK1.ITEM1 = 'Y' 
THEN

....

Oracle Forms will attempt to resolve the reference to :BLOCK1.ITEM1. When you are writing library code, there is no way to resolve these references, since the library could potentially be attached to any form.

Instead you need to use the Copy() and Name_In() Built-ins when referencing Oracle Forms objects within libraries. These Built-ins do not attempt to resolve references at compile time. So the above code would become :

Copy ('Value','BLOCK1.ITEM1');
or
IF
Name_In ('BLOCK1.ITEM1') = 'Y' 
THEN
...