2015-02-24 35 views
0

我想了解一个SQL,我不能执行不幸的。我卡在代码的一部分OWB wb_rt_constants定义

 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的定义将高度赞赏?

回答

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