Re: DEFAULT value for a DATETIME Column
Posted in 1997
Topics: Data Types & Schema Design
Can you explain why someone would use a datetime data type in this situation?
It seems to me that a 4 byte date column would suffice and save a byte. Is
date math easier when the type is datetime??
Rod Fredette
Medicode, Inc.
rfredet@medicode.com
In article <E4IpDy.6vF@nonexistent.com>, jake@apparel.net says...
>
>Bappy wrote:
>>
>> I am have problem running the following statement
>>
>> CREATE TABLE XX
>> (
>> XX_ID CHAR(30) NOT NULL,
>> XX_NM CHAR(30) DEFAULT 'DEMOGRAPHICS UNAVAILABLE ',
>> XX_STA_DT DATETIME YEAR TO DAY DEFAULT '1997-01-23',
>> XX_MAX_PMT_AMT DECIMAL(9,0) DEFAULT -1,
>> XX_INCL CHAR(1) DEFAULT 'Y'
>> )>> ;
>>
>> It error's out and complains that '1997-01-23' is not in a valid
>> format. I gave tried a several other format's i.e. '1997/01/23'.
>> Nothing seem to work.
>
>Bappy, try this:
>XX_STA_DT DATETIME YEAR TO DAY
> DEFAULT datetime ('1997-01-23') year to day,
>--
> -- Jake Salomon
> . .
> _..-'( )`-.._
> ./'. '||\\\\. }\\_/{ .//||` .`\\.
> ./'.|'.'||||\\\\|.. )o o( ..|//||||`.`|.`\\.
> ./'..|'.|| |||||\\`````` \\'@'/ ''''''/||||| ||.`|..`\\.
> ./'.||'.|||| ||||||||||||. | .|||||||||||| ||||.`||.`\\.
> /'|||'.|||||| ||||||||||||{ | }|||||||||||| ||||||.`|||`\\
> '.|||'.||||||| ||||||||||||{ | }|||||||||||| |||||||.`|||.`
>'.||| ||||||||| |/' ``\\||`` | ''||/'' `\\| ||||||||| |||.`
>|/' \\./' `\\./ \\!|\\ /|!/ \\./' `\\./ `\\|
>V V V }' `\\ /' `{ V V V
>\\ \\ \\ V / / /
>+-----------------------------------------------------------+
>| Impeccable Logic: A thought process which successfully |
>| resists chicken bites |
>+-----------------------------------------------------------+
>