At 2:50 PM +0100 2000-01-22, Stefan Vesterlund wrote:
>Yes, and no...
>I have Timestamp on the column "Updated", as I understand
>from the manual, only one Timestamp is automatic - the first
>one. Anyway, I don't wan't the "Created" column to change, ever,
>so Timestamp is not really what I wan't there.
>
>Besides that, should it not be possible to have NOW() as a default
>value?
>
>Stefan
No. Default values must be constants.
>
>
>> -----Original Message-----
>> From: Sinisa Milivojevic [mailto:sinisa@stripped]
>> Sent: den 22 januari 2000 12:57
>> To: Stefan Vesterlund; win32@stripped
>> Subject: Re: NOW() as default value fails
>>
>>
>> On Sat, 22 Jan 2000, Stefan Vesterlund wrote:
>> >Hi
>> >Have a problem, I try to to create a table
>> >with a field that is going to have the default
>> >value of now(). From whet I can read in the manual
>> >the syntax below seem correct. I have tried many
>> >variants, but they all fail.
>> >
>> >If I remove NOW() from the code below, the table
>> >is created without error (otherwise I get 'syntax error
>> >near now()').
>> >
>> >Any ideas?
>> >
>> >
>> >CREATE TABLE Artiklar (
>> > OID int NOT NULL DEFAULT 0,
>> > Rubrik varchar (255) NULL ,
>> > created datetime DEFAULT NOW(),
>> > updated timestamp ,
>> > ArtikelTyp varchar (50) NULL DEFAULT 'std')
>> > )
>> >
>> >
>> >Regards
>> >
>> >Stefan
>>
>>
>> HI!
>>
>> You will accomplish what you need if you define that column as TIMESTAMP.
>>
>> Regards,
>>
>> Sinisa
>>
>> +----------------------------------------------------------------------+
>> | TcX ____ __ _____ _____ ___ == mysql@stripped |
>> | /*/\*\/\*\ /*/ \*\ /*/ \*\ |*| Sinisa Milivojevic |
>> | /*/ /*/ /*/ \*\_ |*| |*||*| mailto:sinisa@stripped |
>> | /*/ /*/ /*/\*\/*/ \*\|*| |*||*| Larnaka, Cyprus |
>> | /*/ /*/ /*/\*\_/*/ \*\_/*/ |*|____ |
>> | ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^ |
>> | /*/ \*\ Developers Team |
>> +----------------------------------------------------------------------+
>>
>> ---------------------------------------------------------------------
>> Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
>> posting. To request this thread, e-mail win32-thread1354@stripped
>>
>> To unsubscribe, send a message to the address shown in the
>> List-Unsubscribe header of this message. If you cannot see it,
>> e-mail win32-unsubscribe@stripped instead.
>>
>
>---------------------------------------------------------------------
>Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
>posting. To request this thread, e-mail win32-thread1359@stripped
>
>To unsubscribe, send a message to the address shown in the
>List-Unsubscribe header of this message. If you cannot see it,
>e-mail win32-unsubscribe@stripped instead.
--
Paul DuBois, paul@stripped