Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cannot set a mysql-function as default value for column with date type

Status
Not open for further replies.

hakie

Programmer
Sep 7, 2002
3
NL
In MSSQL it is possible to, when creating a database tables from file, to set a default value for a column through a function call. F.E.:

create table tbl.....(
..
CDATE DATE NOT NULL DEFAULT GETDATE(),
..
)

Why is this not possible within MYSQL?
I used:
CREATE TABLE tbl.. (
..
CDATE DATE NOT NULL DEFAULT NOW(),
..
) TYPE=MyISAM;
 
try curdate() instead of now() ______________________________________________________________________
There's no present like the time, they say. - Henry's Cat.
 
curdate() doesn't work either. It seems none of the functions can be called.
 
Exactly!, that's what i thought.
It's a shame it isn't possible.

Thanks anyway!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top