解决java传递参数是String类型,pgsql的numeric字段接收报错问题
来源:互联网 发布:网络药品销售 规定 编辑:程序博客网 时间:2024/05/29 11:47
postgresql对传入的参数类型匹配相当严格
如select * from user where id = #id#
假设id类型为numeric,而传入的id为string的话postgresql就会报错:
--- Cause: org.postgresql.util.PSQLException: ERROR: operator does not exist: numeric = character varying
建议:No operator matches the given name and argument type(s). You might need to add explicit type
casts.
位置:125
Caused by: org.postgresql.util.PSQLException: ERROR: operator does not exist: numeric = character varying
建议:No operator matches the given name and argument type(s). You might need to add explicit type
casts.
暂时想到的解决方法:
select * from user where id = cast(#id# as numeric)
如果哪位大神有更好的方法请告知!
阅读全文
1 0
- 解决java传递参数是String类型,pgsql的numeric字段接收报错问题
- Java-String类型的参数传递问题
- Java-String类型的参数传递问题
- Java-String类型的参数传递问题
- Java-String类型的参数传递问题
- Java-String类型的参数传递问题
- Java-String类型的参数传递问题
- Java-String类型的参数传递问题
- Java-String类型的参数传递问题
- [Java]String类型的参数传递问题
- Java-String类型的参数传递问题
- Java-String类型的参数传递问题
- Java-String类型的参数传递问题
- Java中String类型的参数传递问题的解析
- Java中String类型的参数传递问题的解析
- Java中String类型的参数传递问题的解析
- Java中String类型的参数传递问题的解析
- Java中String类型的参数传递问题的解析
- 软件开发中常见知识总结
- Mysql修改初始密码/忘记密码
- android 流布局实例
- [NOIP2011真题]聪明的质监员
- android 高级之旅 (十一) shareSDK的接入与使用
- 解决java传递参数是String类型,pgsql的numeric字段接收报错问题
- mysql performance_schema主要几个性能优化表介绍
- Glide加载CenterCrop属性的圆角图片无效
- hdu 1796 容斥原理
- Angular CLI 安装和使用以及安装失败的解决方法
- python json
- JavaScript学习
- C/C++中extern关键字详解
- number one