Update Table

Hello All,

I have a RunBaseBatch class where I am calling a table ABC and inserting a record.

till here everything is working fine but now I want to update a record in this table

any idea how to do it???

I am trying this following code snippet

if(value1 == table_needs_to_be _updated.Value1 &&

value2 == table_needs_to_be _updated.Value2)

{

ttsBegin;

table_needs_to_be _updated.selectForUpdate(true);

table_needs_to_be _updated.Value1= someValue;

semesterCost.update();

ttsCommit;

info(“Same Records cannot be Inserted”); /// if same record is inserted again.

}

Please advice