Обсуждение: default date

Поиск
Список
Период
Сортировка

default date

От
"Krasnow, Greg"
Дата:
How can I create a table which has a date field and have the date field
default to the system time when the record is inserted... like Oracle's DATE
DEFAULT SYSDATE?  Thanks.

- Greg


Greg Krasnow
HNC Software Inc.
Financial Solutions Group
Senior Software Engineer
Email: gak@hnc.com
Direct Phone: 619.799.8341
Fax: 619.799.8036



Re: [GENERAL] default date

От
Sferacarta Software
Дата:
Hello Krasnow,,

lunedì, 3 agosto 98, you wrote:

KG> How can I create a table which has a date field and have the date field
KG> default to the system time when the record is inserted... like Oracle's DATE
KG> DEFAULT SYSDATE?  Thanks.

KG> - Greg


KG> Greg Krasnow
KG> HNC Software Inc.
KG> Financial Solutions Group
KG> Senior Software Engineer
KG> Email: gak@hnc.com
KG> Direct Phone: 619.799.8341
KG> Fax: 619.799.8036

SYSDATE?? What do you think about CURRENT_DATE? This is SQL standard.

example:

CREATE TABLE mytable (
       mkey  INTEGER,
       mdate DATE DEFAULT CURRENT_DATE
       );


Best regards,
    Jose'                            mailto:sferac@bo.nettuno.it