DB help needed to solve issue with pimitemtable

Pablo Sanchez pablo at blueoakdb.com
Tue Dec 11 21:59:17 GMT 2018


[ Comments below, in-line ]


On Tue, 11 Dec 2018 22:42:40 +0100, Erik Quaeghebeur wrote:

> On dinsdag 11 december 2018 21:34:26 CET, Pablo Sanchez wrote:

>> Assuming there are zero rows, change the default to current_timestamp():
>>
>>    ALTER TABLE pimitemtable ALTER atime
>>    SET DEFAULT current_timestamp();
> 
> mysql> ALTER TABLE pimitemtable ALTER atime SET DEFAULT 
> current_timestamp();
> ERROR 1064 (42000): You have an error in your SQL syntax; check the 
> manual that corresponds to your MySQL server version for the right 
> syntax to use near 'current_timestamp()' at line 1
> 

Hi Erik,

What version of MySQL do you have?

SHOW VARIABLES LIKE "%version%";

Please quote the objects ...

ALTER TABLE `pimitemtable` ALTER `atime` SET DEFAULT current_timestamp();

Now, if that doesn't work, please try this:

ALTER TABLE `pimitemtable` MODIFY `atime`
timestamp NOT NULL DEFAULT current_timestamp();

and just for grins:

SELECT CURRENT_TIMESTAMP();


> 
>> After you do the above, try the original update.  If all works well, 
>> have a celebratory beverage.
> 
> I'm having that anyway.
> 
> 

:)

--
Pablo Sanchez - Blueoak Database Engineering, Inc
Ph:    819.459.1926        iNum:  883.5100.0990.1054




More information about the kdepim-users mailing list