6 messages in com.mysql.lists.win32Re: DataType Question
FromSent OnAttachments
Melissa Dougherty14 Jun 2006 06:28 
Melissa Dougherty14 Jun 2006 07:24 
Armando14 Jun 2006 17:22 
Melissa Dougherty14 Jun 2006 18:40 
Petr Vileta14 Jun 2006 20:22 
Helen M Hudson14 Jun 2006 23:21 
Subject:Re: DataType Question
From:Melissa Dougherty (meli@cse-corp.com)
Date:06/14/2006 06:40:33 PM
List:com.mysql.lists.win32

I'm using MySQL 5.0.19 and I'm loading the data using MySQL Front. I've tried using decimal(10,2) and double(12,2), both gave me the data truncated error.

Is there an easier way to load data into the database.... other than using MySQL Front?

Melissa

Decimal, Double and Float will all allow negative numbers.

A little more information would be helpful... what version of MySQL are you using? How are you loading your data in the CVS file into the table? What length are you setting for the datatype? (ie; 7,2) Cheers.

Melissa Dougherty wrote:

I've converted the data.... but when I try to insert into a table with either decimal or double.... I get 'data truncated for column.... 1265' error. What numeric datatype with allow for negative numbers? I looked at the MySQL site and thought they would work.

----- Original Message ----- From: "Don Lancaster" <DLan@envstd.com> To: "Melissa Dougherty" <meli@cse-corp.com> Sent: Wednesday, June 14, 2006 9:38 AM Subject: RE: DataType Question

You could write a stored procedure to convert the data. Accept as string, and for each value with parentheses, strip the parentheses and tack on the negative sign. I didn't see anything in the MySQL reference manual about currency.

-----Original Message----- From: Melissa Dougherty [mailto:meli@cse-corp.com] Sent: Wednesday, June 14, 2006 9:29 AM To: win@lists.mysql.com Subject: DataType Question

I'm importing data into MySQL from a CVS file.... one column has dollar amounts. There are negative numbers like this... (999.99). Is there a way to get the database to convert this into.... -999.99? And what is the best datatype to choose?

Thanks,