暂无图片
使用antdb数据库,出现“ERROR: operator does not exist: character = integer”提示。
我来答
分享
暂无图片 匿名用户
使用antdb数据库,出现“ERROR: operator does not exist: character = integer”提示。

求助,使用antdb数据库,出现“ERROR: operator does not exist: character = integer”提示,这该怎么解决啊?

我来答
添加附件
收藏
分享
问题补充
1条回答
默认
最新
暂无图片
亚信安慧AntDB数据库

解决方式

Postgresql8.3以后取消了数据类型隐式转换,因此比较的数据类型需要一致。
AntDB兼容了2种语法模式:默认的postgres和兼容的oracle。
oracle语法模式下,AntDB已经自研兼容了部分数据类型隐式转换的场景,包括该问题的场景已经兼容。
postgres语法模式下,依然会报该错误。
下面给出一个示例说明:

antdb=# \d sy02
Table "public.sy02"
Column | Type | Modifiers
--------+-----------------------+-----------
id | character varying(10) |

antdb=# set grammar TO postgres;
SET
antdb=# select count(*) from sy02 where id=123;
ERROR: operator does not exist: character varying = integer
LINE 1: select count(*) from sy02 where id=123;
^
HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts.
antdb=# set grammar TO oracle;
SET
antdb=# select count(*) from sy02 where id=123;
count
-------
0
(1 row)

原因说明

为了兼容oracle语法,AntDB自研兼容了较大部分的oracle数据类型隐式转换的场景。
建议优先尝试使用oracle语法模式。

暂无图片 评论
暂无图片 有用 1
打赏 0
回答交流
提交
问题信息
请登录之后查看
邀请回答
暂无人订阅该标签,敬请期待~~
暂无图片墨值悬赏