default date

Started by Krasnow, Gregover 27 years ago2 messagesgeneral
Jump to latest
#1Krasnow, Greg
gak@hnc.com

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

#2Sferacarta Software
sferac@bo.nettuno.it
In reply to: Krasnow, Greg (#1)
Re: [GENERAL] default date

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