ORA-01722: 无效数字

问题:select * from pc_production_monthly where entity_id=2

ORA-01722: 无效数字_第1张图片

出错原因:entity_id本是char(10)类型的,应该加单引号。

即:正确的语句应该这样写:

select * from pc_production_monthly where entity_id='2';

但很奇怪的是,entity_type为char(1)类型,select * from pc_production_monthly where entity_type=2就不会报错。

而且,当字段时varchar类型时,也不报错。

就当是oracle的一个bug吧!

 

 

你可能感兴趣的:(ORA-01722: 无效数字)