MySQL Forums
Forum List  »  InnoDB

setting default values on a field as sum of other fields
Posted by: Sally Masipa
Date: December 17, 2008 02:40AM

hi

is it possible to assign a default value for field as the sum of other fields from the same table As per below


ALTER TABLE `hr`.`Leave` MODIFY COLUMN `Leave_Outstanding` DECIMAL(10,0) DEFAULT 'Leave_Brought_Forward + Current_Leave';

when running this I get an error number 1067;

if not what id the alternate way of doing it? please provide details

thanks in advance



Edited 1 time(s). Last edit at 12/17/2008 02:41AM by Sally Masipa.

Options: ReplyQuote


Subject
Views
Written By
Posted
setting default values on a field as sum of other fields
4795
December 17, 2008 02:40AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.