| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Date ... Date ...Da
I think there is a difference between implicit type promotion and
implicit type casting.
SQL, like many other languages, implictly promotes types along a
predefined promotion chain (e.g. smallint => int => bigint => decimal)
So smallint + bigint rewuires no casts and the result is defined as bigint.
Where things get tricky, I think, is when fundamentally different types
collide. Such as '1' || 2 or '1' + 2
The SQL Standard requires explicit typing here. In my opinion rightly so.
Realistically many DBMS however have gone down the path of defining some
sort of rules (which may or may not match other vendors') to allow for
implicit casts across types.
So '1' || 2 => '12' and '1' + 2 = 3
IMHO this is a desease like GOTO, you can fight it, but it will find its
way into the language one way or another.
Coming from a DBMS that does use strong casting but acquired another that doesn't, my outlook is glum. The SQL standard will need to adjust to the reality of implicit casting or become irrelevant in that regard.
Just my two cents.
Serge
-- Serge Rielau DB2 SQL Compiler Development IBM Toronto LabReceived on Sun Apr 18 2004 - 10:06:33 CDT
![]() |
![]() |