I see that you are using the Oracle e-Business Suite model and data packages.
In this software package, FND_RELEASE declared as AUTHID CURRENT_USER (i.e. it uses invoker rights). This can be seen in the first line of the package specification.
This means that the table FND_PRODUCT_GROUPS considered in this query ...
select release_name from fnd_product_groups order by product_group_id;
... NOT APPS.FND_PRODUCT_GROUPS .. this is the table FND_PRODUCT_GROUPS owned by the current user.
Since this user probably does not have the FND_PRODUCT_GROUPS table, FND_RELEASE generates error ORA-00942: table or view does not exist when trying to execute this query.
This causes it to go to its WHEN OTHERS exception handler, which causes it to return false when the output parameters are set to Unknown.
One way to solve this problem is to create a custom wrapper for FND_RELEASE that uses certain rights. Like this:
create or replace package xxcust_fnd_release AUTHID DEFINER IS function get_release (release_name out nocopy varchar2, other_release_info out nocopy varchar2) return boolean; end xxcust_fnd_release; create or replace package body xxcust_fnd_release IS function get_release (release_name out nocopy varchar2, other_release_info out nocopy varchar2) return boolean IS BEGIN return fnd_release.get_release (release_name, other_release_info); END; end xxcust_fnd_release; grant execute on xxcust_fnd_release to <your_other_username>;
If you do this and change your script as follows, it will work:
declare l_release_name varchar2(30); l_other_release_info varchar2(2000); begin if not apps.XXCUST_FND_RELEASE.get_release (l_release_name, l_other_release_info) then null; end if; dbms_output.put_line(l_release_name); end;
SEQUENTIAL WORK
If you cannot or do not want to create a new wrapper package in the APPS scheme, you can simply create a synonym for FND_PRODUCT_GROUPS in your other custom scheme.
For instance,
create or replace synonym fnd_product_groups FOR apps.fnd_product_groups;
... do it in your other circuit and your original script will work.
The disadvantage of this alternative is that the Oracle patch can change the FND_RELEASE logic to introduce other queries into other tables, as a result of which this solution will break until you create any additional synonyms.