Home » U++ Library support » U++ SQL » Creating a TIMESTAMP column in MySQL
|
|
|
Re: Creating a TIMESTAMP column in MySQL [message #32222 is a reply to message #32220] |
Sun, 01 May 2011 22:00 |
|
bushman
Messages: 134 Registered: February 2009
|
Experienced Member |
|
|
I've tried that, but it doesn't compile. Actually, a file search for SQLDEFAULT produces
C:\upp\uppsrc\Oracle\OracleSchema.h(51):#define SQLDEFAULT(v) INLINE_ATTRIBUTE("default " v)
C:\upp\uppsrc\plugin\sqlite3\Sqlite3Schema.h(74):#define SQLDEFAULT(v) INLINE_ATTRIBUTE("default " #v)
C:\upp\uppsrc\PostgreSQL\PostgreSQLSchema.h(71):#define SQLDEFAULT(v) INLINE_ATTRIBUTE("default " #v)
, and there seems to be no definition for MySqlSchema.
I finally managed to get what I want by compiling
COLUMN_("TIMESTAMP", Time, RECORD_CREATED, 0, 0) ATTRIBUTE("ALTER TABLE @t change column @c @c timestamp not null default current_timestamp;", ";")
, which yields
RECORD_CREATED timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
Now, what about that?
Thanks!
[Updated on: Sun, 01 May 2011 22:02] Report message to a moderator
|
|
|
|
|
|
Goto Forum:
Current Time: Sat Apr 27 02:59:36 CEST 2024
Total time taken to generate the page: 0.96864 seconds
|