get_release Oracle API返回“未知”结果而不是正确的版本

前端之家收集整理的这篇文章主要介绍了get_release Oracle API返回“未知”结果而不是正确的版本前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
当从apps用户执行下面的get_release函数时,它返回正确的版本:12.1.3,但是当从另一个用户执行它时,它返回未知结果:

declare
l_release_name         varchar2(30);
l_other_release_info   varchar2(2000);
   begin
     if not apps.FND_RELEASE.get_release (l_release_name,l_other_release_info) then
         null;
     end if;
     dbms_output.put_line(l_release_name);
   end;

FND_RELEASE.get_release
 是一个公共包,从其他用户调用它应该没有限制.

我在函数评论中找到的内容如下:

-- get_release() will usually return TRUE
  --  with RELEASE_NAME =
  --                    contents of RELEASE_NAME column in FND_PRODUCT_GROUPS
  --  and OTHER_RELEASE_INFO = null
  --
  -- If FND_PRODUCT_GROUPS.RELEASE_NAME contains imbedded spaces:
  --
  -- get_release() will return TRUE
  --  with RELEASE_NAME = FND_PRODUCT_GROUPS.RELEASE_NAME up to but
  --   not including the first imbedded space
  --  and OTHER_RELEASE_INFO = FND_PRODUCT_GROUPS.RELEASE_NAME
  --   starting with the first non-space character after the first
  --   imbedded space
  --
  -- On failure,get_release() returns FALSE. This will be a performance issue.
  --  Both RELEASE_NAME and OTHER_RELEASE_INFO will be set to 'Unknown'.
  --  This indicates that either:
  --  1) there are no rows in fnd_product_groups
  --     - this can be resolved by populating the row and it will
  --       be queried on the next call.
  --  2) there is more than one row in fnd_product_groups
  --     - delete all but the one correct row from fnd_product_groups and it
  --       will be queried on the next call. It's possible that the values
  --       returned by release_* and *_version routines are still correct if
  --       the first row in fnd_product_groups,ordered by product_group_id,--       if the currect row,but this will still be a performance problem.

以前有人遇到过这个问题吗?!

解决方法

据我所知,有三种可能性:

>使用invoker_rights_clause(AUTHID CURRENT_USER)编译的包FND_RELEASE.它为用户应用程序和任何其他用户使用不同的源.> function FND_RELEASE.get_release使用上下文进行访问.>在您的系统中使用私有数据库选项.它能够重写查询并为当前用户添加条件.(第2点的变化,但是隐含)

猜你在找的Oracle相关文章