Jump to content

Is it possible to put a multiplication problem in the mysql "default value".....


Recommended Posts

Is it possible to put a multiplication problem in the mysql "default value" field?

In my script I need to take the unit amount * quantity, I know how to do this in php, but can I just put my equation in the "default value" field in MYSQL and make it equal to another field?... Like excell?

 

Thanks

From MySQL website(http://dev.mysql.com/doc/refman/5.0/en/data-type-defaults.html):

The DEFAULT value clause in a data type specification indicates a default value for a column. With one exception, the default value must be a constant; it cannot be a function or an expression.

It appears that you can't do this.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.