Compiling .fmb to .fmx file but unable too because of compilation errors stopping it.

I'm trying to compile the .fmb to create an up-to-date .fmx file. But when I compile it, I get compilation errors and stop it from creating an up-to-date .fmx file.

My questions is: Does it has to be no compilation errors inorder for the form builder to create an up-to-date .fmx file? Or What am I doing wrong?  I'm working on the file that has been worked on by a previous programmer and this .fmb is the original file that the programmer has worked on and compiled the .fmb to .fmx file.

Here is some of the errors:
PL/SQL Error 201 at line 42, column 42 identifier 'LOOKUP_IBR' must be declared
PL/SQL Error 0 at line 42, column2 Statement ignored.
Who is Participating?
CetusMODConnect With a Mentor Commented:
PAQed with points refunded (50)

Community Support Moderator
Yes there should be no errors for a .fmx file to be created from a .FMB.

Make sure your form builder is connected to the correct database while compiling.

Looks like either are you're missing a column or a table
try searching for the program units where the errors occur (Form Builder: Menu "Program" - "Find and Replace PL/SQL" - search for "LOOKUP_IBR").
maybe this will give you some hints ...

by the way: LOOKUB_IBR sounds like the (default) name of a database trigger for the table LOOKUP ("IBR": "Insert Before Row") ...
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

jhstinsonAuthor Commented:
Well, I'm not at the client site now to be able to take a look at the code at the moment. But if I remember correctly, LOOKUP_IBR  is the name of the function. It was in one of the level tree (I think this is the correct term for it) and didn't have the function for it in the same level. Is it possible to call a function from another level. FYI, I'm still new to Oracle...
with "level tree" do you mean the object navigator in forms builder?

if LOOKUP_IBR is a function, there may be some reasons to get the error:

a pl/sql library (*.pll/*.plx) containing this function is not attached to the form.

LOOKUP_IBR is a database function and you have no privileges to use it or it does'nt exist (check it in sqlplus: DESC LOOKUP_IBR).

did you use the right user and database connection when compiling the fmb to fmx?
jhstinsonAuthor Commented:
1.)How do you attached the pl/sql library(*.pll/*.plx) to the form? So just put the same file with the (*.pll/*.plx) within the same folder?

2.) It should be the right user since I'm logging in as administrator user and the database should be right also because all database structure is the same for 2-3 years.
libraries can be attached with (hardcoded) path or just as logical object. in most cases the forms are attached in the second way, so they only have to exist in the path where forms has access to.

storing all form files (menu, form, library) in the same folder is the most common way ...

how do you generate *.fmb to *.fmx: using form builder or with the command line tool (ifbld60.exe, ifbld90.exe, ...)?
jhstinsonAuthor Commented:
I just use Crtl-T in the form builder.
use Menu "Program" - "Compile" - "All" (SHIFT+CTRL+K) do recompile the whole form. if there are no errors, create the fmx with CTRL-T.

if there are errors, check where the error occurs (Menu "Program" - "Find and Replace PL/SQL" - search for "LOOKUP_IBR").
is it a forms trigger, a forms program unit, a library program unit or a database object?
jhstinsonAuthor Commented:
It is in the forms program unit and in the procedure body(one of the LEVEL)
you have to check INSIDE of the procedure what is missing.

you should execute the same (or similar) code in sqlplus as same user to make sure tat you have access to all objects.

maybe if you're  posting parts of the code we can see a little bit more ...
jhstinsonAuthor Commented:
I was about to post up the code for you to take a look at. It seem like it is reading from a file, I think. But I can't find the path of the file.

PUT procedure writes data in a file at the filesystem. look at a previous TEXT_IO.FOPEN command where file and path of this file are defined.

but the main problem didn't change: you don't have access to the function LOOKUP_IBR or this function doesn't exist.

in the procedure where the error occurs maybe there is defined a cursor with loop where the record prop_rec.drug_type is declared. check if this is varchar2, number or date and check in sqlplus:

SELECT lookup_ibr('ABC', '29') from dual; -- if prop_rec.drug_type is VARCHAR2
SELECT lookup_ibr(1, '29') from dual; -- if prop_rec.drug_type is NUMBER
SELECT lookup_ibr(SYSDATE, '29') from dual; -- if prop_rec.drug_type is DATE

is there still an error because lookup_ibr does not exist?

jhstinsonAuthor Commented:
Yes, there still an error because lookup_ibr does not exist as a column. The drug_type is an varchar2 data type. What the purpose of doing the select command like that? I have never done it that way before for the column.
jhstinsonAuthor Commented:
FUNCTION Arrest_Exists (complainid_in  IN  VARCHAR2,
                        incd_seq_in    IN  VARCHAR2)
  CURSOR arrest_cur IS
    SELECT nameid
      FROM arrest
     WHERE arrest.complainid = complainid_in
       AND arrest.incd_seq   = incd_seq_in;
   arrest_rec    arrest_cur%ROWTYPE;
   return_value  BOOLEAN;
  OPEN arrest_cur;
  FETCH arrest_cur INTO arrest_rec;
  IF arrest_cur%FOUND THEN
        return_value := TRUE;
        return_value := FALSE;
  RETURN return_value;
          Raise_Stop_Alert('The following error occurred in the Arrest_Exists function for '||complainid_in||'-'||incd_seq_in||': '||SQLERRM);
          RETURN FALSE;

Ok, here is a short code of a function and it is throwing an error of:
Error 201 at line 25, column 6 identifier 'RAISE_STOP_ALERT' must be declared
Error 0 at line 25, column 6 Statement ignored.

I think I am missing something when I'm trying to compile this file.

jhstinsonAuthor Commented:
Ok, I found the function for Lookup_IBR. I have to open another file(PL/SQL Libraries). I didn't realized you have to open two files to get the form and the function into the Object Navigator. Now, how do I compile the form so that it is connected to the PL/SQL Libraries without getting an compilation errors?
jhstinsonAuthor Commented:
Nevermind, I figure it out now. I had to attached to the form inorder to create the fmx file. Thanks for your help though.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.