Hi John I added the Update clause and got an error I removed it and got an error re MovetoCurrentRow I just can't seem to get the correct sequence of code :( ***************************************** //if we have two records to update // i.e. the penultimate record which was closed at the last 6-hour point // and the ultimate record which was opened at the same time and has since closed if ((two_time) && (!initialize) && (myCanTrade) && (myCurrPositionValue >0)) { // retrieve the last two records rs = s.executeQuery("SELECT * FROM TABLE ORDER BY Trading_Date ASC," + " Trading_Time ASC OFFSET x ROWS FETCH NEXT 2 ROWS ONLY"); rs.next(); rs.moveToCurrentRow(); rs.updateDouble("PROFIT_LOSS", prev_profit); rs.updateRow(); prev_profit = 0; //move on to the last record rs.next(); rs.moveToCurrentRow(); rs.updateDouble("PROFIT_LOSS", profit); rs.updateRow(); two_time =false; } // end of updating the last two records *************************************
Bob M -- View this message in context: http://apache-database.10148.n7.nabble.com/Updating-a-couple-of-records-errors-still-tp143778.html Sent from the Apache Derby Users mailing list archive at Nabble.com.