Inserting Multiple Values with Set

Inserting Multiple Values with Set

am 01.01.2010 20:34:48 von Victor Subervi

--001636417335fad3ff047c1f76e0
Content-Type: text/plain; charset=ISO-8859-1

Hi;
mysql> describe products;
+--------------------------+-------------------------------- ------------------------------------------------------------ -------------------------------------------------------+---- --+-----+---------+----------------+
| Field |
Type
| Null | Key | Default | Extra |
+--------------------------+-------------------------------- ------------------------------------------------------------ -------------------------------------------------------+---- --+-----+---------+----------------+
| ID | tinyint(5)
unsigned
| NO | PRI | NULL | auto_increment |
| SKU |
varchar(40)
| NO | UNI | NULL | |
| Category |
varchar(40)
| YES | | NULL | |
| Name |
varchar(50)
| NO | | NULL | |
| Title |
varchar(100)
| NO | | NULL | |
| Description |
mediumtext
| NO | | NULL | |
| Price |
float(8,2)
| YES | | NULL | |
| SortFactor |
int(4)
| YES | | 500 | |
| Availability |
tinyint(1)
| NO | | 1 | |
| OutOfStock |
tinyint(1)
| NO | | 0 | |
| ShipFlatFee |
float(5,2)
| NO | | 10.00 | |
| ShipPercentPrice | tinyint(2)
unsigned
| NO | | 5 | |
| ShipPercentWeight | tinyint(2)
unsigned
| NO | | 2 | |
| pic0 |
mediumblob
| YES | | NULL | |
| pic1 |
mediumblob
| YES | | NULL | |
| sizes |
set('Extra-small','Small','Medium','Large','XLarge','XXLarge ','XXXLarge')
| YES | | NULL | |
| colorsShadesNumbersShort |
set('blue:333399','gray:465945','purple:50404D','navy-blue:C C7722','fuchsia:FF77FF','aqua:7FFFD4','maroon:B03060','black :0000FF','yellow:9ACD32')
| YES | | NULL | |
+--------------------------+-------------------------------- ------------------------------------------------------------ -------------------------------------------------------+---- --+-----+---------+----------------+
17 rows in set (0.00 sec)

The following insert chokes when I try to insert multiple values from the
sets:

insert into products (SKU, Category, Name, Title, Description, Price,
SortFactor, Availability, OutOfStock, ShipFlatFee, ShipPercentPrice,
ShipPercentWeight, sizes, colorsShadesNumbersShort) values("prodSKU1",
"prodCat1", "name1", "title1", "descr", "12.34", "500", "1", "0", "10.00",
"5", "2", "Extra-small", "'aqua:7FFFD4', 'blue:333399'");

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

Please advise.
TIA,
Victor
--
The Logos has come to bear
http://logos.13gems.com/

--001636417335fad3ff047c1f76e0--

Re: Inserting Multiple Values with Set

am 01.01.2010 22:34:00 von Don Read

On Fri, 1 Jan 2010 14:34:48 -0500 Victor Subervi said:

> Hi;


> The following insert chokes when I try to insert multiple values from the
> sets:
>
> insert into products (SKU, Category, Name, Title, Description, Price,
> SortFactor, Availability, OutOfStock, ShipFlatFee, ShipPercentPrice,
> ShipPercentWeight, sizes, colorsShadesNumbersShort) values("prodSKU1",
> "prodCat1", "name1", "title1", "descr", "12.34", "500", "1", "0", "10.00",
> "5", "2", "Extra-small", "'aqua:7FFFD4', 'blue:333399'");
>

INSERT INTO products ...
...., ('aqua:7FFFD4', 'blue:333399'));

http://dev.mysql.com/doc/refman/5.0/en/set.html

Regards,

--
Don Read don_read@att.net
It's always darkest before the dawn. So if you are going to
steal the neighbor's newspaper, that's the time to do it.

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=gcdmg-mysql-2@m.gmane.org

Re: Inserting Multiple Values with Set

am 01.01.2010 22:45:44 von Victor Subervi

--001517570988339f6f047c214bca
Content-Type: text/plain; charset=ISO-8859-1

On Fri, Jan 1, 2010 at 4:34 PM, Don Read wrote:

> On Fri, 1 Jan 2010 14:34:48 -0500 Victor Subervi said:
>
> > Hi;
>
>
> > The following insert chokes when I try to insert multiple values from the
> > sets:
> >
> > insert into products (SKU, Category, Name, Title, Description, Price,
> > SortFactor, Availability, OutOfStock, ShipFlatFee, ShipPercentPrice,
> > ShipPercentWeight, sizes, colorsShadesNumbersShort) values("prodSKU1",
> > "prodCat1", "name1", "title1", "descr", "12.34", "500", "1", "0",
> "10.00",
> > "5", "2", "Extra-small", "'aqua:7FFFD4', 'blue:333399'");
> >
>
> INSERT INTO products ...
> ..., ('aqua:7FFFD4', 'blue:333399'));
>
> http://dev.mysql.com/doc/refman/5.0/en/set.html
>
> Thanks
V

--001517570988339f6f047c214bca--