Data won't display a negative value

[expired user #6802]'s profile image [expired user #6802] posted 11 years ago in General Permalink
Hi There,

I created a table to test importing some data from a CSV file (figured that out eventually) however I have a problem in a lot of my rows there are negative values, in some there are only negative values however, when I click the DATA tab next to query they are all shown only as 0.00 or 0 depending - I set these values to decimal but even attempting to manually insert still only gets the 0.

What's the go here - some quick looking on your forum shows me that this should have already been fixed or have I done something wrong?

I'm using the latest version on WINE.
kalvaro's profile image kalvaro posted 11 years ago Permalink
Seeing no sample data or CREATE TABLE statements it's difficult to say what's wrong. Are you sure that data fits in your column data type?
kalvaro's profile image kalvaro posted 11 years ago Permalink
Additionally, if you run this before importing data:

SET @@SESSION.sql_mode='TRADITIONAL';


... you should get error messages instead of bogus insertions.
[expired user #6802]'s profile image [expired user #6802] posted 11 years ago Permalink
CREATE TABLE `Trades` (
`Provider Ticket` DECIMAL(10,10) UNSIGNED NULL DEFAULT NULL,
`Broker Ticket` INT(10) UNSIGNED NULL DEFAULT NULL,
`Type` TEXT NULL COLLATE 'utf8_general_mysql500_ci',
`Currency` TEXT NULL COLLATE 'utf8_general_mysql500_ci',
`Standard Lots` DECIMAL(10,1) UNSIGNED NULL DEFAULT NULL,
`Date Open` DATETIME NULL DEFAULT NULL,
`Date Close` DATETIME NULL DEFAULT NULL,
`Price Open` DECIMAL(10,5) UNSIGNED NULL DEFAULT NULL,
`Price Close` DECIMAL(10,5) UNSIGNED NULL DEFAULT NULL,
`Highest Profit (Pips)` DECIMAL(10,0) NULL DEFAULT NULL,
`Worst Drawdown (Pips)` DECIMAL(10,2) UNSIGNED NULL DEFAULT NULL,
`Interest` DECIMAL(10,2) UNSIGNED NULL DEFAULT NULL,
`Profit (pips)` DECIMAL(10,2) UNSIGNED NULL DEFAULT NULL,
`Profit ($)` DECIMAL(10,2) UNSIGNED NULL DEFAULT NULL
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB;

This is the data directly from CSV, tab spaced. I got a fair few error messages (64) for this data (an example of one row)

400.1307612679 3562997 BUY EUR/USD 0.1 2011/06/10 01:25:37 2011/06/14 07:08:13 1.4548 1.44644 2 -228 0.14 -83.6 -83.46
[expired user #6802]'s profile image [expired user #6802] posted 11 years ago Permalink
@Kalvaro - sorry (very new to this) how do I do that?
[expired user #6802]'s profile image [expired user #6802] posted 11 years ago Permalink
I seem to have got it to work, ticking "unsigned" did the tricksmilehappy
kalvaro's profile image kalvaro posted 11 years ago Permalink
Sure. What you did think "unsigned" meant? xD

Please login to leave a reply, or register at first.