SilasTheMonk has asked for the wisdom of the Perl Monks concerning the following question:
I have some SQL that works fine on mysql but which uses the "NOW()" function. However this does not work on SQLite because by default that has no "NOW()" function. The DBD::SQLite man page describes how you can add a NOW function, but that only fixes SQLite not the general portability problem. Looking at perlport scares me even more. The definition of epoch varies from OS to OS so you cannot even rely on the time function. So the question is what is the most portable and lightweight SQL compatible way of generating today's date?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: NOW SQL portability
by almut (Canon) on Dec 22, 2009 at 10:31 UTC | |
by SilasTheMonk (Chaplain) on Dec 22, 2009 at 10:37 UTC | |
by almut (Canon) on Dec 22, 2009 at 11:05 UTC | |
|
Re: NOW SQL portability
by herveus (Prior) on Dec 22, 2009 at 12:31 UTC | |
|
Re: NOW SQL portability
by Your Mother (Archbishop) on Dec 22, 2009 at 15:30 UTC | |
by SilasTheMonk (Chaplain) on Dec 22, 2009 at 20:08 UTC | |
|
Re: NOW SQL portability
by rpnoble419 (Pilgrim) on Dec 22, 2009 at 21:07 UTC | |
by erix (Prior) on Dec 22, 2009 at 22:49 UTC | |
|
Re: NOW SQL portability
by stonecolddevin (Parson) on Dec 23, 2009 at 20:01 UTC |