Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

duplicate row

 
paul beppe
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thi is code:
[Edit - fixed line width]

don't duplicate row...why???
 
paul beppe
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have edit:

[Edit - fixed line width]

but always this problems....nothing copy!!!

why?
 
Rob Spoor
Sheriff
Pie
Posts: 20495
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It surprises me you didn't get an error with the first statement. The number of place holders (?) does not match the number of values specified for them.

As far as the second is concerned, are you sure that your SELECT query gives you any results?
 
paul beppe
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes....i have result in my select!!!

 
Matthew Brown
Bartender
Posts: 4565
8
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As Rob says, that first one should have thrown an exception. The fact that you mention it suggests that you're suppressing any exceptions you get (e.g. a catch block that does nothing). If that's the case, fix it, because it's possible your second example is also throwing an exception.

For instance, one thing I can think of that would cause it is a unique constraint on that table for one of the fields you're adding.
 
paul beppe
Ranch Hand
Posts: 86
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to copy the same recordset in the same table .... with a selection to the JList

 
Matthew Brown
Bartender
Posts: 4565
8
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And are you certain that you're not getting any exceptions?
 
Wendy Gibbons
Bartender
Posts: 1110
Eclipse IDE Oracle VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have auto comit turned off?
 
Kemal Sokolovic
Bartender
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
paul beppe wrote:i have edit:

[Edit - fixed line width]

but always this problems....nothing copy!!!

why?


If the table you're trying to insert data into contains primary key(s), then an exception is thrown when trying to do this, because you're trying to insert another row with the same key; make sure you catch that one. Other thing might be that the SELECT does not return any rows, so no rows are inserted either.

paul beppe wrote:yes....i have result in my select!!!

Relax dude, people are trying to help you.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic