List:General Discussion« Previous MessageNext Message »
From:mblack Date:October 7 1999 4:06pm
Subject:Re: Column Defaults
View as plain text  
According to the manual, TIMESTAMP will update every time the
current record is changed.  This, by the functionality, would be
more appropiate for a date_modified field than a date_created field.
It sure would be nice to set the default of a field to a return value of
a system function like SYSDATE, the same as AUTO_INCREMENT
works for numeric fields.

Michael Black

On Thu, 07 Oct 1999, sinisa@stripped wrote:
> mblack writes:
>  > Is it possible to set the default of a column to the result of a function
>  > when creating or altering a table?
>  > 
>  > Ex:     date_created datetime default SYSDATE(),
>  > --
>  > Michael Black, Senior Consultant
>  > CRM and ERM Specialist
>  > Information Management Systems Consulting, Inc.
>  > www.imsconsulting.com
>  > 18500 Von Karman, Suite 540
>  > Irvine, CA 92612 USA
>  > Voice 877.756.5757
>  > Fax   949.862.5600
>  > 
>  > 
>  > 
>  > 
> 
> HI!
> 
> No, there is no general feature like that, but for your example there
> is a column type of TIMESTAMP.
> 
> Read about it in a manual.
> 
> 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 mysql-thread15456@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 mysql-unsubscribe@stripped instead.
--
Michael Black, Senior Consultant
CRM and ERM Specialist
Information Management Systems Consulting, Inc.
www.imsconsulting.com
18500 Von Karman, Suite 540
Irvine, CA 92612 USA
Voice 877.756.5757
Fax   949.862.5600
Thread
Column Defaultsmblack7 Oct
  • Re: Column Defaultssinisa7 Oct
    • Re: Column Defaultsmblack7 Oct
      • Re: Column DefaultsMichael Widenius8 Oct
    • Re: Column DefaultsGerald Clark7 Oct