OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
Re: Another Inserting Multiple Values with Set Problem

From: Victor Subervi (victorsubervigmail.com)
Date: Fri Jan 08 2010 - 00:56:21 CST


OK, guys, I'm totally confused:

mysql> insert into products (SKU, Category, Name, Title, Description, Price,
SortFactor, Availability, OutOfStock, Weight, ShipFlatFee, ShipPercentPrice,
ShipPercentWeight, sizes, colorsShadesNumbersShort) values ("prodSKU1",
"prodCat1", "name1", "title1", "descr", "12.34", "500", "1", "0", "2.5",
"10", "5", "2", "('Small, Medium, XSmall')", "('teal_E2725B, black_0000FF,
olive_6B8E23, yellow_9ACD32')");
Query OK, 1 row affected, 2 warnings (0.00 sec)

mysql> show warnings;
+---------+------+---------------------------------------------------------------+
| Level | Code |
Message |
+---------+------+---------------------------------------------------------------+
| Warning | 1265 | Data truncated for column 'sizes' at row
1 |
| Warning | 1265 | Data truncated for column 'colorsShadesNumbersShort' at
row 1 |
+---------+------+---------------------------------------------------------------+
2 rows in set (0.00 sec)

mysql> truncate products;
Query OK, 0 rows affected (0.00 sec)

mysql> insert into products (SKU, Category, Name, Title, Description, Price,
SortFactor, Availability, OutOfStock, Weight, ShipFlatFee, ShipPercentPrice,
ShipPercentWeight, sizes, colorsShadesNumbersShort) values ("prodSKU1",
"prodCat1", "name1", "title1", "descr", "12.34", "500", "1", "0", "2.5",
"10", "5", "2", "('Small', 'Medium', 'XSmall')", "('teal_E2725B',
'black_0000FF', 'olive_6B8E23', 'yellow_9ACD32')");
Query OK, 1 row affected, 2 warnings (0.00 sec)

mysql> truncate products;
Query OK, 0 rows affected (0.00 sec)

mysql> insert into products (SKU, Category, Name, Title, Description, Price,
SortFactor, Availability, OutOfStock, Weight, ShipFlatFee, ShipPercentPrice,
ShipPercentWeight, sizes, colorsShadesNumbersShort) values ("prodSKU1",
"prodCat1", "name1", "title1", "descr", "12.34", "500", "1", "0", "2.5",
"10", "5", "2", "Small, Medium, XSmall", "teal_E2725B, black_0000FF,
olive_6B8E23, yellow_9ACD32");
Query OK, 1 row affected, 2 warnings (0.00 sec)

mysql> insert into products (sizes, colorsShadesNumbersShort) values
('Large, Small','aqua_7FFFD4, fuchsia_FF77FF');
Query OK, 1 row affected, 6 warnings (0.01 sec)

mysql> show warnings;
+---------+------+---------------------------------------------------------------+
| Level | Code |
Message |
+---------+------+---------------------------------------------------------------+
| Warning | 1364 | Field 'SKU' doesn't have a default
value |
| Warning | 1364 | Field 'Name' doesn't have a default
value |
| Warning | 1364 | Field 'Title' doesn't have a default
value |
| Warning | 1364 | Field 'Description' doesn't have a default
value |
| Warning | 1265 | Data truncated for column 'sizes' at row
1 |
| Warning | 1265 | Data truncated for column 'colorsShadesNumbersShort' at
row 1 |
+---------+------+---------------------------------------------------------------+
6 rows in set (0.00 sec)

mysql> describe products sizes;
+-------+----------------------------------------------------------------------+------+-----+---------+-------+
| Field |
Type | Null
| Key | Default | Extra |
+-------+----------------------------------------------------------------------+------+-----+---------+-------+
| sizes |
set('XSmall','Small','Medium','Large','XLarge','XXLarge','XXXLarge') | YES
| | NULL | |
+-------+----------------------------------------------------------------------+------+-----+---------+-------+
1 row in set (0.00 sec)

mysql> describe products colorsShadesNumbersShort;
+--------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
| Field |
Type
| Null | Key | Default | Extra |
+--------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
| colorsShadesNumbersShort |
set('black_0000FF','yellow_9ACD32','teal_E2725B','olive_6B8E23','green_00A550','white_0F4D92','silver_708090','red_FE2712','lime_32CD32')
| YES | | NULL | |
+--------------------------+-------------------------------------------------------------------------------------------------------------------------------------------+------+-----+---------+-------+
1 row in set (0.00 sec)

How, o how, do I insert into sets???
TIA,
V