ORA-00932:不一致的数据类型

时间:2015-09-21 15:45:02

标签: oracle plsql

我正在尝试通过PL / SQL对一个对象进行CAST MULTISET,我收到了主题中提到的错误。

我已经检查了对象本身中定义的数据类型以及表中的列,它们似乎匹配。我获得值和对象中的顺序的顺序也是如此。

但我一直收到错误,这是完整的代码:

CREATE OR REPLACE TYPE TASK_DESTINATION_LIST_OBJTYP AS OBJECT
(
ENTITY_ID NUMBER(9)
,ENTITY_CODE NUMBER(3)
,ENTITY_NAME VARCHAR2(255)
,ENTITY_FAVOTIRE NUMBER(1)
,ENTITY_PATH VARCHAR2(1535) 
,STATE_CODE NUMBER(3)
,STATE_NAME VARCHAR2(50)
,RES_MSG VARCHAR2(2000)
)

/
CREATE TYPE TASK_DESTINATION_LIST_COLTYP AS TABLE OF TASK_DESTINATION_LIST_OBJTYP

查询:

SELECT   Decode (tsk_info_t.dest_dev_id,NULL,
                 tsk_info_t.dest_srv_id, 
                 tsk_info_t.dest_dev_id)     AS entity_id,
         Decode (tsk_info_t.dest_dev_id,
                 NULL,1,3) AS entitytyp_code,
         Decode (tsk_info_t.dest_dev_id,NULL,
                 tsk_info_t.dest_srv_name, 
                 tsk_info_t.dest_dev_name) AS entity_name,
         ( 
                SELECT Count(*) 
                FROM   pref_info_t 
                WHERE  Nvl (dev_id, 0) = Nvl (tsk_info_t.dest_dev_id, 0) 
                AND    srv_id = tsk_info_t.dest_srv_id) AS entity_favotire, 
         Decode (tsk_info_t.dest_dev_id,NULL, 
         ( 
                SELECT path 
                FROM   entity_path_view 
                WHERE  dev_id IS NULL 
                AND    srv_id = tsk_info_t.dest_srv_id), 
         ( 
                SELECT path 
                FROM   entity_path_view 
                WHERE  dev_id = dest_dev_id 
                AND    srv_id = dest_srv_id)) AS entity_path, 
         tsk_info_t.state_code                AS state_code, 
         ( 
                SELECT state_type_name 
                FROM   ref_state_type 
                WHERE  state_type_code = state_code ) AS state_name, 
         tsk_info_t.res_msg                           AS res_msg 
FROM     tsk_info_t 
WHERE    tsk_info_t.tsk_id = 5957 
ORDER BY tsk_info_t.dest_srv_name, 
         tsk_info_t.dest_dev_name ASC) 
  AS task_destination_list_coltyp ) 
AS destination_list

0 个答案:

没有答案