Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Date ... Date ...Da

Re: Date ... Date ...Da

From: Serge Rielau <srielau_at_ca.eye-be-em.com>
Date: Sun, 18 Apr 2004 11:06:33 -0400
Message-ID: <c5u5i7$jvr$1@hanover.torolab.ibm.com>


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 Lab
Received on Sun Apr 18 2004 - 10:06:33 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US