Re: Date manipulation
Posted in 1998
Jeff Larsen wrote:
> On a table with a DATE column I can do
> select datecol from tab where datecol = today + 1;> But I get a syntax error on
> insert into tab (datecol) values (today + 1);> Why the inconsistency?
Because the INSERT...VALUES statement originated in ESQL (in the IBM
System R prototype) and was designed to take a list of variables.
No expressions are allowed in the VALUES list. And consistency has
never been SQL's strong point...
> Is there a workaround?
INSERT INTO tab(datecol)
SELECT TODAY + 1
FROM "informix".SysTables
WHERE tabid = 1;
--
Jonathan Leffler (jleffler@informix.com, jleffler@earthlink.net)
Guardian of DBD::Informix v0.60 -- see http://www.perl.com/CPAN
#include <disclaimer.h>