using DEFAULT with update
Posted in 2003
Topics: General Discussion
Hi, I want to add the modification date and time to some tables. To make it easier I tried something like "... COLNAME datetime year to second DEFAULT CURRENT year to second". I tried to update and insert by using the DEFAULT keyword explicitely as it is possible with some DBMS. I know that I can use CURRENT year to second directly with the update clause, but I was just wondering if there is something similar to "update TABNAME set COLNAME = DEFAULT" Best regards, Michael
michael wrote: > I want to add the modification date and time to some tables. To make it > easier I tried something like "... COLNAME datetime year to second DEFAULT > CURRENT year to second". > > I tried to update and insert by using the DEFAULT keyword explicitely as it > is possible with some DBMS. I know that I can use CURRENT year to second > directly with the update clause, but I was just wondering if there is > something similar to "update TABNAME set COLNAME = DEFAULT" There's an feature request for such - I'm pretty sure it isn't available. Doesn't DEFAULT only apply on INSERT? I guess you can make a case for it in UPDATE, but... -- Jonathan Leffler #include <disclaimer.h> Email: jleffler@earthlink.net, jleffler@us.ibm.com Guardian of DBD::Informix v2003.04 -- http://dbi.perl.org/
> I tried to update and insert by using the DEFAULT keyword explicitely as it > is possible with some DBMS. I know that I can use CURRENT year to second > directly with the update clause, but I was just wondering if there is > something similar to "update TABNAME set COLNAME = DEFAULT" Default values are used only in INSERT statements, if column for which default value is defined, is not initialized or if you're trying to insert a NULL value in that column. Gorazd