Im using Oracle Forms 10.1.2.0.2. I have declared a procedure in several forms that executes a query and then enables or disables some items depending on the number of query hits. The procedure is always the same and it's something like this:
PROCEDURE QUERY(prBlock IN VARCHAR2, prQuery IN VARCHAR2) IS
SET_BLOCK_PROPERTY(prBlock , ONETIME_WHERE, prQuery);
ENABLE_ITEMS(GET_BLOCK_PROPERTY(prBlock ,QUERY_HITS) > 0,prBlock);
Problem is that I want to add this procedure to a library, but I can't find a way to call ENABLE_ITEMS so that every form enables/disables their appropiate items. Is there a way to call a procedure declared in a forms program unit from a library?
Thanks for your time Lars and DanielB; I just want to place this QUERY() procedure in the library because it's exactly the same on each form I have.
Writing specific ENABLE_ITEMS() procedures for each form and then adding them to a library or puting all the different ENABLE_ITEMS() code in one BIG procedure and then send parameters doesn't seem as useful to me as having different ENABLE_ITEMS() on each form.
What do you think?
Since your ENABLE_ITEMS() procedure is unique to each form, it is best to keep it as a Program Unit in each form. Unfortunately, you will not be able to reference the Program Unit from your PL/SQL Library procedure. You will just have to call your library procedure and then call your ENABLE_ITEMS() program unit seperately in your code.
Hope this helps,
Craig B-) If someone's response is helpful or correct, please mark it accordingly.
create ENABLE_ITEMS() with the same parameters in the library your code can be
the procedure must be exactly in parameters and types than each one of each form
you compile the library
then attach to form
when the library call a procedure the program units of forms have preference and runs the form program unit and ENABLE_ITEMS() of library never is called