Win a copy of Kotlin for Android App Development this week in the Kotlin forum!
  • 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
  • Devaka Cooray
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Junilu Lacar
  • Paul Clapham
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • salvin francis
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

CSV File returns empty values  RSS feed

 
Master Rancher
Posts: 1085
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
 
Bartender
Posts: 20334
110
Android Eclipse IDE Linux
  • 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: 3887
45
  • 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
Master Rancher
Posts: 1085
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.
 
All of the world's problems can be solved in a garden - Geoff Lawton. Tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
https://coderanch.com/t/704633/RavenDB-Open-Source-NoSQL-Database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!