• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem in insert mulpitle rows

 
chain singh
Ranch Hand
Posts: 117
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello

i am inserting multiple row in sqlserver. this query return in a text file
i have to separately insert each row so i have to tokenize the data from query

please help me to tokenize the query which is following

insert into Employee values
('chain','singh','bika.gmailll'),
('chain','singh','bikaccccc.gmailll');


and i wanted by code to make

insert into Employee values ('chain','singh','bika.gmailll')
insert into Employee values ('chain','singh','bikaccccc.gmailll')
 
Eduardo Moranchel
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually you only need a lot of string parsing.
But here it is how you usually do this:


is not the best code (i know) but should point you in the right direction
Also where the system.out.println is is where you need yo add the string to a collection to return it or call directly the insert in the jdbc.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic