0

我正在尝试理解一条我无法执行的 SQL。我被困在代码的一部分

     wb_rt_constants.to_string (e.audit_status) AS audit_status_symbol

我似乎找不到 wb_rt_constants.to_string 做什么?是某种解码吗?有人可以解释一下吗

wb_rt_constants.to_string

正在尝试做,最好是 wb_rt_constants.to_string 的定义将受到高度赞赏?

4

1 回答 1

0

不幸的是,包体OWBSYS.wb_rt_constants被包装了,所以我们看不到它的实现源代码。

无论如何,该函数to_string具有以下签名:

function to_string(p_constant in number) return varchar2;

它在一些 OWBSYS 视图中使用,例如ALL_RT_AUDIT_EXECUTIONS并且似乎将数字 ID 转换为描述性字符串,例如

col execution_audit_status format a20

select distinct e.audit_status,
       wb_rt_constants.to_string(e.audit_status) as execution_audit_status
  from wb_rt_audit_executions e;

AUDIT_STATUS EXECUTION_AUDIT_STAT
------------ --------------------
       16002 BUSY
       16004 COMPLETE

这些数字似乎与同一包的这些函数的输出相匹配:

select wb_rt_constants.EXECUTION_STATUS_INACTIVE,
       wb_rt_constants.EXECUTION_STATUS_BUSY,
       wb_rt_constants.EXECUTION_STATUS_READY,
       wb_rt_constants.EXECUTION_STATUS_COMPLETE
  from dual;

EXECUTION_STATUS_INACTIVE EXECUTION_STATUS_BUSY EXECUTION_STATUS_READY EXECUTION_STATUS_COMPLETE
------------------------- --------------------- ---------------------- -------------------------
                    16001                 16002                  16003                     16004
于 2015-02-24T07:43:07.240 回答