Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Import data from text file into database

 
dave walpole
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I already have data in my database (Java Derby), but i also have some more data in my text file which are purely names and their phone numbers, as i do not want to add them one by one which will take years to complete, is there by any chance of importing the
data within my text file into the database?
 
Paul Clapham
Sheriff
Posts: 21572
33
Eclipse IDE Firefox Browser MySQL Database
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There should be a possibility, yes. I know almost nothing about Derby but when I used the keywords derby import for a web search, I came up with a page full of promising-looking resources. So give it a try and let us know if I'm leading you down a rathole or if you find something good.
 
dave walpole
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I found something regarding to mysql but i will update if i get something right as you suggested. 
 
dave walpole
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have found some solutions thats working for others but in my case it doesnt.
this piece of code should enter the data into my table, but throws an exception .

Error code 30000, SQL state 38000: The exception 'java.sql.SQLSyntaxErrorException: Column 'COLUMN2' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'COLUMN2' is not a column in the target table.' was thrown while evaluating an expression.

Error code 99999, SQL state 42X04: Column 'COLUMN2' is either not in any table in the FROM list or appears within a join specification and is outside the scope of the join specification or appears in a HAVING clause and is not in the GROUP BY list. If this is a CREATE or ALTER TABLE  statement then 'COLUMN2' is not a column in the target table.

 
Dave Tolls
Ranch Hand
Posts: 2102
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What does the data look like?
Does it match the format required by the SYSCS_IMPORT_TABLE utility?
 
dave walpole
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the data is purely names, which are combined with only letters and seperated by 'space' . 1 name in every row
 
Dave Tolls
Ranch Hand
Posts: 2102
15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But does that match what the import tool is expecting?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic