Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
bushman is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: MySqlSession::GetTransactionLevel() implementation
Next Topic: fetch not reading into struct
Goto Forum:
  


Current Time: Sun May 12 20:35:15 CEST 2024

Total time taken to generate the page: 0.01776 seconds