List:MySQL on Win32« Previous MessageNext Message »
From:Paul DuBois Date:January 23 2000 3:29am
Subject:RE: NOW() as default value fails
View as plain text  
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
Thread
Slow inserts on Win32Sean Mitchell22 Jan
  • NOW() as default value failsStefan Vesterlund22 Jan
    • Re: NOW() as default value failsSinisa Milivojevic22 Jan
  • Re: Slow inserts on Win32Sinisa Milivojevic22 Jan
    • RE: Slow inserts on Win32Dennis Thrys√łe22 Jan
      • Just set up a Linux box running Apache..Graham Ogunleye23 Jan
  • Why a license for Windows ?Patrik Lundin23 Jan
  • Re: Why a license for Windows ?Fredrick Bartlett23 Jan
  • Re: Why a license for Windows ?Patrik Lundin23 Jan
    • Re: Why a license for Windows ?Tim Endres23 Jan
    • Re: Why a license for Windows ?Paul DuBois23 Jan
  • Re: Why a license for Windows ?Patrik Lundin23 Jan
  • Re: Why a license for Windows ?PeterWR24 Jan
  • Re: Why a license for Windows ?Patrik Lundin24 Jan
    • RE: Why a license for Windows ?John W Pierce24 Jan
      • Re: Why a license for Windows ?Matthias Fichtner24 Jan
    • Re: Why a license for Windows ?Paul DuBois24 Jan
      • Re: Why a license for Windows ?Mark A. Chalkley <chalkle@ibm.net>24 Jan
  • Re: Why a license for Windows ?Patrik Lundin24 Jan
  • Slow inserts on Win32Michael Widenius2 Feb
RE: NOW() as default value failsStefan Vesterlund22 Jan
Re: Slow inserts on Win32sinisa22 Jan
RE: NOW() as default value failsPaul DuBois23 Jan
RE: Why a license for Windows ?Gerald R. Jensen24 Jan