描述字段上的数据类型不一致错误

Inconsistent datatype error on description field

我正在尝试运行以下代码来查询我的数据库并将一些行转换为列。

代码基本上可以工作,但由于某种原因我收到以下错误:

ORA-00932:数据类型不一致:预期 - 得到 CLOB 00932.00000 - "inconsistent datatypes: expected %s got %s"

这是我的代码:

select * from (

select 

j.project_key
,j.issue_type
,j.assignee
,j.reporter
,j."SUMMARY"
,j.priority
,j.status
,j.date_created
,to_char(next_day(j.date_created,'sunday'),'iw') as "Created Week"
,to_char(j.date_created, 'MON' ) as "Created Month"
,to_char(j.date_created, 'YYYY' ) as "Created Year"
,j.date_updated
,to_char(next_day(j.date_updated,'sunday'),'iw') as "Updated Week"
,to_char(j.date_updated, 'MON' ) as "Updated Month"
,to_char(j.date_updated, 'YYYY' ) as "Updated Year"
,j.date_resolved
,to_char(next_day(j.date_resolved,'sunday'),'iw') as "Resolved Week"
,to_char(j.date_resolved, 'MON' ) as "Resolved Month"
,to_char(j.date_resolved, 'YYYY' ) as "Resolved Year"
,j.due_date
,j.timespent
,j.description
,custom.CUSTOMVALUE 
,custom.CUSTOM_FIELD_NAME

from JIRA02.FCI4JIRA_COMMON_VIEW j

INNER JOIN JIRA02.FCI4JIRA_CUSTOMFIELD_VIEW custom ON j.project_key = custom.PKEY
)

pivot 
(
   MAX (CUSTOMVALUE)
   for (CUSTOM_FIELD_NAME) in ('Team','Fix/Resolution','Apps','Action Item','Tag','Saves:Tickets/week','Saves:Hours/week','Saves:Requests/week','Saves Justification')
)

我已经设法将问题隔离到这行代码

,j.description

如果我根本不包括这一行,代码 运行 没问题。

我已经尝试转换该字段,但这给我带来了另一个问题。

,to_char(j.description)

ORA-22835:缓冲区太小,无法进行 CLOB 到 CHAR 或 BLOB 到 RAW 的转换(实际:7939,最大值:4000) 22835. 00000 - "Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: %s, maximum: %s)"

非常感谢任何帮助。

dbms_lob.substr( clob_column, for_how_many_bytes, from_which_byte )

所以不要 ,j.description 试试下面的方法

,dbms_lob.substr( description, 100, 1 )

来源:https://asktom.oracle.com/pls/asktom/f?p=100:11:0::NO::P11_QUESTION_ID:367980988799