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

Error during CLOB update

 
Suresh Kanagalingam
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all,
I am coding a java program, using JDBC connection, to update CLOB field. I am getting an error when I try to close 'Write' stream and no data is updated in the CLOB field. The code section I have to update the field does not throw an error. So I am assuming that it is writing the data ok using 'write' method, but not commiting it because the close statement is throwing an error. Here is the code below. Can anyone tell me why this is happening?
I am getting error where it says 'outstream.close()'
Thanks
Suresh
===============================

[ Edited by Dave to add code tags ]
[ February 10, 2002: Message edited by: David O'Meara ]
 
sanjay yermalkar
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have "for update" in your select statement?
I'm pretty sure, It doesn't update it without that.
HTH.
 
hanumanth reddy
Ranch Hand
Posts: 118
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
and also in addtion to the update statement
dont try to access the resilt set more than once
ie comment out the system.out.println(rs.get ....);
 
Suresh Kanagalingam
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sanjay,
I tried with 'FOR UPDATE', but I was getting 'ORA-01002' (fetch out of sequence) error!
Thanks
Suresh
 
Suresh Kanagalingam
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Sanjay,
I found the problem with 'ORA-01002'. Db was set to autocommit. I added a line to setAutoCommit(false) and 'ORA-01002' disappeared.
But I still have the previous problem - it is not updating CLOB field - with 'FOR UPDATE' clause.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic