如何将 CLOB 转换为 varchar ,并用逗号分隔

问题描述 投票:0回答:1

在oracle中编写plSQL脚本。 DM_CATEGORY 列的数据类型是 varchar 。 othertext 列的数据类型是 CLOB,它返回逗号分隔的数据。例如FGOH,功能参数,残疾参数,认知参数

脚本

where DM_CATEGORY in (select othertext from Preslists where tablename='tablename' and functionname='functionname' )

如何在这个clus中传递这些数据? 使用此脚本出现以下错误 ORA-00932: 数据类型不一致: 预期 - 得到 CLOB 00932. 00000 - “数据类型不一致:预期 %s 得到 %s”

在oracle中编写plSQL脚本。 DM_CATEGORY 列的数据类型是 varchar 。 othertext 列的数据类型是 CLOB,它返回逗号分隔的数据。例如FGOH,功能参数,残疾参数,认知参数

脚本

where DM_CATEGORY in (select othertext from Preslists where tablename='tablename' and functionname='functionname' )

如何在这个clus中传递这些数据? 使用此脚本出现以下错误 ORA-00932: 数据类型不一致: 预期 - 得到 CLOB 00932. 00000 - “数据类型不一致:预期 %s 得到 %s”

sql oracle plsql
1个回答
0
投票

尝试将 CLOB 转换为 varchar: 脚本:where to_char(DM_CATEGORY) in (从 Preslists 中选择其他文本,其中 tablename='tablename' 和 functionname='functionname' )

或者: dbms_lob.substr(DM_CATEGORY, 4000, 1)

而“4000”是 Varchar 定义的大小。

© www.soinside.com 2019 - 2024. All rights reserved.