• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to update TimeStamp in Oracle database

 
somenath chatterjee
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I want to copy date from one table to another with column type like eg: BLOB, CLOB, RAW, TimeStamp data. But when i am going to update timestamp datatype in target table its giving error:

Internal Error: Unable to construct a Datum from the specified input

giving some code for understanding clearly-

rs = stmt.executeQuery("SELECT COUNT(*) AS rowcount FROM "+ srcTable);
while(rs.next()){
rowCount = rs.getRow();

rSet = stmt.executeQuery("SELECT * FROM "+srcTable);
rsTarget = stmtTarget.executeQuery("SELECT "+srcColumn+" FROM "+tarTable);
while (rSet.next() && rsTarget.next()) {
if(srcColType.equals("BLOB")){

// this blob data successfily updating in target table try {
blobVal = rSet.getBlob(srcColumn);
rsTarget.updateBlob(srcColumn, blobVal);
} catch (Exception e) {
e.printStackTrace();}
/* this part showing error message Internal Error: Unable to construct a Datum from the specified input*/
try {
time = rSet.getTimestamp(srcColumn);
rsTarget.updateTimestamp(srcColumn, time);
} catch (Exception e) {
e.printStackTrace();}
rsTarget.updateRow();
}
}

Please Let me know if you faced similar problem and the solution if available
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!