Re: Regarding date formats



Michel Cadot wrote:
> "Frank van Bortel" <frank.van.bortel@xxxxxxxxx> a écrit dans le message de news: dp365a$km1$1@xxxxxxxxxxxxxxxxxxxxxxxxxx
> |
> | Because you have a decode, and that does (datatype) conversions.
> | "Oracle7 automatically converts the return value to the same
> | datatype as the first result."
> | Your first result is -1, the outcome of the decode would therefore
> | become numeric. As your assignment datatype is date, a conversion
> | will take place, and that will go through a varchar2. As this is
> | an implicit conversion, the default date format mask is applied,
> | "DD-MON-RR".
> |
> | As case statement would prevent this, but isn't available in Oracle7.
> | --
> | Regards,
> | Frank van Bortel
> |
> | Top-posting is one way to shut me up...
>
> The first result is NULL (not -1) which is of VARCHAR2 datatype.
> This does not change the rest of your post: date->varchar2->date conversion
> and the application of implicit date format.
>
> Regards
> Michel Cadot
>

You are correct; here's the relevant bit, copy/pasted from
the 9i SQL Reference Manual (and not wrongly interpreted
from the 7.3 printed manual):
"Oracle automatically converts the return
value to the same datatype as the first result.
If the first result has the datatype CHAR or
if the first result is null, then Oracle converts
the return value to the datatype VARCHAR2."

--
Regards,
Frank van Bortel

Top-posting is one way to shut me up...
.



Relevant Pages

  • Re: Character conversion table
    ... its in the msdb database and its called MSdatatype_mappings. ... datatype in SQL Server to a datatype in access. ... > I have been told a conversion table exist in either the master or the msdb ... > the ability to modify named characters into another named character, ...
    (microsoft.public.sqlserver.replication)
  • Re: conversion date datatype to long datatype
    ... DateTime data type, which is an eight-byte integer value. ... implicit conversion between the Date and Double data types. ... Do you wanna return long value for any specific reason? ... How to convert DateTime datatype to Long Datatype. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: conversion date datatype to long datatype
    ... DateTime data type, which is an eight-byte integer value. ... implicit conversion between the Date and Double data types. ... Do you wanna return long value for any specific reason? ... How to convert DateTime datatype to Long Datatype. ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: CASE Statement Question
    ... It's not a limitation with CASe, but it is a limitation with data type ... conversion. ... CASE returns only one datatype, and which datatype that is, is ... INT has the highest datatype precedence, so what happens is that SQL ...
    (microsoft.public.sqlserver.programming)
  • Re: How can I create a YES/NO column?
    ... etc), however, you could always add a 'bit' or 'char' datatype and give it a ... this within the app. ... Regards ... Rob ...
    (microsoft.public.inetserver.asp.general)