Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 464
  • Last Modified:

Importing CSV to MySQL DB

Hello Experts,

When importing a csv file to a mysql db my neagtive numbers come in as zeros (0.00)

columns are decimal(50,2)

Any ideas?
0
decoded
Asked:
decoded
  • 2
  • 2
1 Solution
 
johanntagleCommented:
What method are you using to import?
0
 
decodedAuthor Commented:
i am using the GUI that Php admin provides. Is there something better solution.
0
 
johanntagleCommented:
Can you provide phpmyadmin version, structure of the table being imported to, and a sample csv file?  I will try to replicate.
0
 
decodedAuthor Commented:
Please see data example.
example.csv

i am currently MYSQL workbench to see it would help and same problem.

my db layout:
CREATE TABLE `er` (
  `Ticker` text NOT NULL,
  `CompanyName` text NOT NULL,
  `Exchange` text NOT NULL,
  `Shareout` decimal(50,2) NOT NULL,
  `Last` decimal(50,2) NOT NULL,
  `MarketCap` decimal(50,2) NOT NULL,
  `EnterpriseValue` decimal(50,2) NOT NULL,
  `Rev_LTM` decimal(50,2) NOT NULL,
  `Rev_NTM` decimal(50,2) NOT NULL,
  `EPS_LTM` decimal(50,2) NOT NULL,
  `EPS_NTM` decimal(50,2) NOT NULL,
  `EBITDA_LTM` decimal(50,2) NOT NULL,
  `EBITDA_NTM` decimal(50,2) NOT NULL,
  `EBIT_LTM` decimal(50,2) NOT NULL,
  `TotalDebt` decimal(50,2) NOT NULL,
  `Equity` decimal(50,2) NOT NULL,
  `WorkingCapital` decimal(50,2) NOT NULL,
  `TotalAssets` decimal(50,2) NOT NULL,
  `RetainedEarnings` decimal(50,2) NOT NULL,
  `Capex` decimal(50,2) NOT NULL,
  `OCF` decimal(50,2) NOT NULL,
  `id` int(11) NOT NULL AUTO_INCREMENT,
  PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=501 DEFAULT CHARSET=latin1$$

Open in new window

0
 
InsoftserviceCommented:
i would suggest you download sqlyog. You can import / export ur table from csv to sql easily.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now