ORA-00932: inconsistent datatypes: expected NUMBER got CHAR

来源:互联网 发布:飞行仿真软件 编辑:程序博客网 时间:2024/05/29 14:24

ORA-00932: inconsistent datatypes: expected NUMBER got CHAR:

获取的目标类型与源类型不一致,多出现在case when 语句中,when的结果类型与源类型不一致的情况,如:

case u.user_type_id when '1' then '经理' else '普通职员'

此时,user_type_id是number类型的,就会报此错误,将when后的 ‘1’ 改成 1 即可

1 0
原创粉丝点击