[kronolith] error in your SQL syntax near 'NOW() NOT NULL

Paul Cooper pgc@ucecom.com
Mon, 10 Dec 2001 14:16:42 -0500


On Mon, Dec 10, 2001 at 11:44:30AM +0000, Jan Schneider wrote:
> Zitat von Martin List-Petersen <martin@list-petersen.dk>:
> 
> > <-snip->
> > > >  ERROR 1064: You have an error in your SQL syntax near 'NOW() NOT
> > NULL,
> > > >      event_end datetime DEFAULT NOW() NOT NULL,
> > > >      event_alarm i' at line 13
> > > >  mysql>
> > >
> > > We're still trying to find cross database compatible sql statements.
> > No
> > > luck! :-/
> > > Remove the DEFAULT NOW() part or replace it with DEFAULT '0000-00-00
> > > 00:00:00'
> > >
> > 
> > <-snip->
> > 
> > Why not just forget the DEFAULT in this case, which should be ok for
> > most
> > sql servers and handle it from the PHP code (allways putting the right
> > values in the fields).
> 
> This is probably the best solution, but programmers are lazy, you know? ;-)

Well AFAICT the code never actually assumes or uses the default, it 
always populates the date fields, so there :-P Anyway since 0000-00-00 
00:00:00 is an invalid date postgres won't accept it as a default. Either 
we should change it to a valid date 0000-01-01 00:00:00 or leave it out 
all together.

Paul  

> Jan.
> 
> ::::::::::::::::::::::::::::::::::::::::
> AMMMa AG - discover your knowledge
> :::::::::::::::::::::::::::
> Detmolder Str. 25-33 :: D-33604 Bielefeld
> fon +49.521.96878-0 :: fax  +49.521.96878-20
> http://www.ammma.de
> ::::::::::::::::::::::::::::::::::::::::::::::
> 
> -- 
> Kronolith mailing list: http://horde.org/kronolith/
> Frequently Asked Questions: http://horde.org/faq/
> To unsubscribe, mail: kronolith-unsubscribe@lists.horde.org

-- 
-----------------------------------------------------------------
Paul Cooper                             |  Tel: 0121 331 7858
Senior Programmer and Database Engineer |  Fax: 0121 331 7859
UCEcom                                  |  mailto:pgc@ucecom.com
University of Central England           |  http://www.ucecom.com
Birmingham, B4 7DX                      |
-----------------------------------------------------------------