How to disable the auto-implicit data type conversion?
412284Jan 6 2004 — edited Jan 6 2004I have a situation need to force the data-type check rather than Oracle auto-implicit data type conversion.
Can you please advise how to disable the auto-implicit data type conversion ? So that it will return error immediately when specifying wrong expression, for example:
col1/col2 while col1 and col2 are type of varchar2.
Below is the test for implicit data type conversion:
SQL> create table aa(a varchar2(5), b varchar2(5)) ;
Table created.
SQL> insert into aa values(50, 50) ;
1 row created.
SQL> select * from aa ;
A B
---------- ----------
50 50
SQL> select a/b from aa where 1=0 ;
no rows selected
SQL> select a/b from aa ;
A/B
----------
1
SQL> insert into aa values('a','b') ;
1 row created.
SQL> select a/b from aa ;
ERROR:
ORA-01722: invalid number
no rows selected
SQL> select a/b from aa where rownum=1 ;
A/B
----------
1