ibatis + spring框架下,对CLOB字段操作

本文介绍在ibatis+Spring框架下,如何处理CLOB类型的字段。特别关注了在进行查询操作时出现的ORA-00932错误,并提供了解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

ibatis + spring框架下,对CLOB字段操作。

TfBTradeInterSend.xml设置:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE sqlMap
PUBLIC "-//ibatis.apache.org//DTD SQL Map 2.0//EN"
"http://ibatis.apache.org/dtd/sql-map-2.dtd">


<sqlMap namespace="TfBTradeInterSend">
<typeAlias alias="TfBTradeInterSend" type="com.sitech.groupcust.common.dto.TfBTradeInterSend"/>

<resultMap id="TfBTradeInterSendResult" class="TfBTradeInterSend">
<result property="tradeId" column="TRADE_ID"/>
<result property="subscribeId" column="SUBSCRIBE_ID"/>
<result property="infaceType" column="INFACE_TYPE"/>
<result property="dealState" column="DEAL_STATE"/>
<result property="dealMsg" column="DEAL_MSG"/>
<result property="resendCount" column="RESEND_COUNT"/>
<result property="sendContent" column="SEND_CONTENT" javaType="java.lang.String" jdbcType="CLOB"/>
<result property="dealDate" column="DEAL_DATE"/>
<result property="inDate" column="IN_DATE"/>
<result property="notes" column="NOTES"/>
<result property="provinceCode" column="PROVINCE_CODE"/>
</resultMap>

t.send_content: 类型是CLOB。

问题描述:根据上面sqlMapClient设置后,当对send_content进行插入、更新操作时,没问题。但是当以send_content:作为查询条件时,报下面的错误:

ORA-00932: inconsistent datatypes

解决:

select * from tf_b_trade_inter_send t where

dbms_lob.instr(t.send_content,'02BBSS000100001348479247031914',1,1)>0

参考:http://www.iteye.com/problems/64807

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值