Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer
Springboot项目,使用postgresql数据库,mybatis做持久层框架,
<select id="select" resultMap="BaseResultMap" parameterType="com.vo.TestVo">
select
<include refid="Base_Column_List" />
from test
where state='2'
<if test="comCode != null" >
and com_code=${comCode}
</if>
</select>
comcode的形式如:'1100'
执行查询时报错:
### The error may exist in file [D:\workspaceAll\eclipseWorkspace\test\target\classes\mapper\custom\test\QcTestDao.xml]
### The error may involve com.dao.TestDao.select-Inline
### The error occurred while setting parameters
### SQL: select id, comcode,name from test where state='2' and com_code=00000000
### Cause: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer
建议:No operator matches the given name and argument type(s). You might need to add explicit type casts.
位置:286
; bad SQL grammar []; nested exception is org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer
建议:No operator matches the given name and argument type(s). You might need to add explicit type casts.
位置:286] with root cause
org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer
建议:No operator matches the given name and argument type(s). You might need to add explicit type casts.
位置:286
解决方法:
<if test="comCode != null" >
and com_code=#{comCode,jdbcType=VARCHAR}
</if>
Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying = integer的更多相关文章
- Cause: org.postgresql.util.PSQLException: ERROR: cached plan must not change result type的前因后果
首先说明一下遇到的问题: PG数据库,对其中的某张表增加一列后,应用报错,信息如下: 应用使用相关框架如下:SpringBoot.MyBatis. ### Cause: org.postgresql. ...
- 【hibernate postgresql】注解@TypeDef/@Enumerated/数据库字段gender为枚举类型,从前台接受到实体后进行保存报错:org.postgresql.util.PSQLException: ERROR: column "gender" is of type gender but expression is of type character varying
数据库字段gender为枚举类型,从前台接受到实体后进行保存报错:org.postgresql.util.PSQLException: ERROR: column "gender" ...
- Caused by: org.postgresql.util.PSQLException: 错误: 语法错误 在 "desc" 、语法错误 在 "from" 附近
此错误一般是由于postgres的数据库表字段名定义与关键字重名所致: 如下,创建的数据库表包含名称为“desc”的字段与倒叙查询的desc关键字冲突会导致Caused by: org.postgre ...
- pg数据库org.postgresql.util.PSQLException: ERROR: "xxx" is not a sequence
问题场景 对pg数据表执行插入语句的时候,报错如下: { "timestamp": 1587012576734, "status": 500, "er ...
- PostgreSql问题:ERROR: operator does not exist: timestamp without time zone > character varying
问题描述: ERROR: operator does not exist: timestamp without time zone > character varying 解决方法: //注意 ...
- Try setting a different JdbcType for this parameter or a different configuration property. Cause: org.postgresql.util.PSQLException: 栏位索引超过许可范围:2,栏位数:1
执行mybaits sql <delete id="delete4BatchesByLineCi" parameterType="java.util.List&qu ...
- Postgresql客户端不能远程连接数据库服务器 org.postgresql.util.PSQLException:
Postgresql安装完成之后,默认情况下是不允许远程客户端直接连接的,并且默认的监听配置文件里边,监听的服务器地址是127.0.0.1即:localhost 报如下错误: org.postgres ...
- org.postgresql.util.PSQLException: 栏位索引超过许可范围:3,栏位数:2。
org.postgresql.util.PSQLException: 栏位索引超过许可范围:3,栏位数:2. 今天在写完SQL进行查询的时候,后台一直报错显示上面的信息.看错误完全不知道原因,就重新检 ...
- org.postgresql.util.PSQLException:致命:抱歉,已经有太多客户了(org.postgresql.util.PSQLException: FATAL: sorry, too many clients already)
我正在尝试连接到Postgresql数据库,我收到以下错误: 错误:org.postgresql.util. PSQLException:致命:抱歉,已经有太多客户 错误是什么意思,我该如何解决? 我 ...
随机推荐
- Nginx的安装和设置
Nginx是一个高性能的HTTP服务器和反向代理服务器.当一个服务器访问量太大时(比如C10k问题,Concurrent 10,000 Connection),就可以安装设置一个Nginx服务器,将客 ...
- 安装babel遇到的异常
Error: Requires Babel "^7.0.0-0", but was loaded with "6.26.3". If you are sure ...
- JAVA MyBatis使用技巧收集
1. 使用事务注解. @Transactional
- Dive into Python
写这篇文章的原因完全是为了督促自己每天晚上看完两章<Dive Into Python>这本书,因此,很多内容都是摘抄自原书的翻译版或者是自己瞎想,于是就顺带着记录了下来.此前已经看完前两章 ...
- 如何修改mac的root密码
mac如果密码忘了,可以同过几个命令重置root密码.前提是你有执行sudo权限的用户: jackdeMacBook-Air:~ jack$ sudo bash jackdeMacBook-Air:~ ...
- 【Linux高级驱动】触摸屏驱动的移植
触摸屏驱动的移植 流程 注意:看框架图 1.添加input.c组件 Device Drivers ---> Input device support ---> Generic inp ...
- Ubuntu python3 安装pip
python2:sudo apt-get install python-pip python3:sudo apt-get install python3-pip 切换python2和python3的版 ...
- LeetCode: Next Permutation 解题报告
Next Permutation Implement next permutation, which rearranges numbers into the lexicographically nex ...
- Django项目实战 - html中用户登录判断
实现逻辑: {% if request.user.is_authenticated %} 个人信息{% else %}登录{% endif %} 直接上代码 {% if request.user.is ...
- sqlmap tamter
支持的数据库 编号 脚本名称 作用 实现方式 all 1 apostrophemask.py 用utf8代替引号 ("1 AND '1'='1") '1 AND %EF%BC%87 ...