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: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Sun, 18 Apr 2004 10:51:19 -0700
Message-ID: <1082310668.273465@yasure>


Serge Rielau wrote:

> 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

I'm in complete agreement. I am not concerned about implicit conversion of numeric types but definitely the ones you've pointed out and others involving date data types and string representations. I am against any language performing implicit conversions such as these.

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Sun Apr 18 2004 - 12:51:19 CDT

Original text of this message

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