• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

CSV File returns empty values  RSS feed

 
Rancher
Posts: 1170
18
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most likely this isn't the right forum to ask this question, but since there isn't an better one to suite my needs, I'll give it a try.
The person fo whom I writting this program used to keep all his dat in an excelsheet.
I normalized the file and created seperate tables.
Now I would like to load the exsisting data in to the db, but already when filling the first table something goes wrong.
I seperated the needed fields in an seperate xls file and created an csv file from it.
But when executing the statement and checking my db if it loaded correct I noticed that everyting is filled with null values.
Anyone an idea how come?

The query I used:


The csv-file:


I included a printscreen of the result too
dbResult.png
[Thumbnail for dbResult.png]
DB Result
 
Saloon Keeper
Posts: 20639
122
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Long posts get less responders. An ideal post is something that where the entire message fits on a single screen. It would have been enough to list a few sample lines; the entire dataset is too much.

If I haven't got my databases crossed, that's a MySQL batch load you're trying to do there.

Now why you're ending up with nulls, rather than either good data or no data is a mystery to me. All I can think to do is recommend a look at the database server logs.
 
Master Rancher
Posts: 4025
47
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


I'm pretty sure that should be only one " mark and not two.
Which would be why you are getting nothing out.

ETA: Also, I don't think you need the first row as the loader uses the column order from the table definition.
 
Daniel Demesmaecker
Rancher
Posts: 1170
18
Firefox Browser Hibernate IntelliJ IDE Java MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@Tim: It was indeed a mysql database

[quote = Dave Tolls]  ETA: Also, I don't think you need the first row as the loader uses the column order from the table definition.

That dosn't make a difference, I ignore the first line, cause Included my column headers in my csv file, but beside that, you were right about the '""', so thanks a bunch.
 
The problems of the world fade way as you eat a piece of pie. This tiny ad has never known problems:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!