Re: Revert a column to its default value

2004-10-22 Thread Egor Egorov
Jonathan Kart [EMAIL PROTECTED] wrote:

 
 Hi all,
 
 
 Is it possible in mysql 3.23 to update a row and revert a column back 
 to its default value.  Not the default value for the type, but the 
 value defined as the column default.
[]
 UPDATE pictures SET picture_name=DEFAULT;  -- don't think this is 
 possible

It works in 4.1.





-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___ ___   __
  /  |/  /_ __/ __/ __ \/ /Egor Egorov
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
   ___/   www.mysql.com




-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Revert a column to its default value

2004-10-20 Thread Jonathan Kart
Hi all,
Is it possible in mysql 3.23 to update a row and revert a column back 
to its default value.  Not the default value for the type, but the 
value defined as the column default.

for example a column is defined as :
picture_name VARCHAR(25) NOT NULL DEFAULT 'no_photo.gif'
if someone removes their picture, I want the value to revert back to 
'no_photo.gif'.  However, as the default value changes across 
installations of our application, I can't explicitly set the column:
UPDATE pictures SET picture_name='no_photo.gif';   -- can't do this
I need to do something like:
UPDATE pictures SET picture_name=DEFAULT;  -- don't think this is 
possible
or:
UPDATE pictures SET picture_NAME=NULL;  -- ideally mysql would revert 
to 'no_photo.gif', but it uses the type default of an empty string

Is this possible?
thanks,
-jk
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]