Question

I have to iterate over each row in SQLITE JDBC on-memory table in order to update the cell value of one of the columns using the cell value of another column in the same row.

E.g. For each row in the table, take cell value of column 3, make some minor changes and put this value in cell of column 6 in the same row.

What would be the best approach for this, lie most optimized way of doing this.

So the main question is how to iterate over each row in table. I am not sure if it's a valid question. But would like to know suggestions or perhaps some sample snippet.

No correct solution

OTHER TIPS

You can use any SQL expression in the UPDATE statement:

stmt.executeUpdate("UPDATE MyTable SET Col6 = Col3 + 123");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top