From: Warren Young Date: June 1 2009 11:26am Subject: Re: ssqls and now() List-Archive: http://lists.mysql.com/plusplus/8583 Message-Id: <8FC89970-E45F-4A8E-A7F2-7E7E5C484AF2@etr-usa.com> MIME-Version: 1.0 (Apple Message framework v935.3) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit On Jun 1, 2009, at 3:47 AM, Mike Naylor wrote: > Assume I'm trying to avoid having multiple sub-SSQLS declarations on > the one table, I'd like to be able to set certain SSQLS fields so > that they don't update the MySQL records on insert or update. I can > set the auto increment field to value zero and this will not cause > the MySQL value to be over written. I'm looking for a way to set > the timestamp field so that too will allow MySQL to do it's own thing. There are at least two different questions here. Let's deal with the one you actually asked first: > row.event_date = mysqlpp::sql_timestamp::now(); Try row.event_date = mysqlpp::sql_timestamp(); Or, just leave it unassigned. This only works with mysqlpp::DateTime, not with Date or Time. I just tried it, so I know it works. > i.e. I'd like to code something like this... > > row.event_date = 0; > > or even better... > > row.event_date = mysqlpp::IGNORE; MySQL++ has no such feature, and I can't see a good reason to add it. It smells like messy thinking, like you haven't thought through the DB schema completely. If you think I'm wrong, show an example where you have two DB tables that logically should be served by a single SSQLS, but which can't work in the current scheme.