MySQL Forums
Forum List  »  Newbie

default NULL problem with CREATE TABLE
Posted by: peter michaux
Date: July 23, 2005 12:18PM

Hi,

I'm trying to create a table with the field 'customer_group_id' having default null. What I tried is attached below. I also tried with customer_group_id line without the first NULL. Either way doesn't seem to be working. Any suggestions greatly appreciated!

Thanks,
Peter



mysql> CREATE TABLE price (
product_variation_id int(10) unsigned NOT NULL,
customer_group_id int(10) unsigned NULL default NULL,
quantity int(10) unsigned NOT NULL default '1',
price decimal(10,2) NOT NULL,
PRIMARY KEY (product_variation_id, customer_group_id, quantity)
) ENGINE=INNODB;

mysql> describe price;
+----------------------+------------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+----------------------+------------------+------+-----+---------+-------+
| product_variation_id | int(10) unsigned | | PRI | 0 | |
| customer_group_id | int(10) unsigned | | PRI | 0 | |
| quantity | int(10) unsigned | | PRI | 1 | |
| price | decimal(10,2) | | | 0.00 | |
+----------------------+------------------+------+-----+---------+-------+
4 rows in set (0.00 sec)

Options: ReplyQuote


Subject
Written By
Posted
default NULL problem with CREATE TABLE
July 23, 2005 12:18PM


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.