I just realized that in Oracle, you can compare a NUMBER column with a
String value.
For example, if there is a table emp with a column emp_no of type NUMBER(4),
You can do
SELECT name FROM emp WHERE empno=123 , no surprise there.
But you can also do
SELECT name FROM emp WHERE empno='123' or
SELECT name FROM emp WHERE empno=' 123 '
and this gets you the same results.
Although
SELECT name FROM emp WHERE empno=' 12 3' gives you an Oracle 'Invalid Number' error.
I am just curious if it is the same for other major databases, because sometimes it is convenient to call setString() for integer parameters, rather than parse it first, esp. when you can be pretty sure that the String being passed is a valid number.
Had anybody had any problems with this before?