Quote:
should i be using insert query instead of update for this particular work?
This kinda says "I have absolutely no idea what I am doing" and that's probably the real problem here.
UPDATE
and
INSERT
queries are very, very different: one changes only existing records, and the other only adds new rows to a a table. That you think they are interchangeable is worrying - and you need to address that before you go much further.
Regardless, the most probable reason it doesn't work is that your WHERE condition is incorrect: if it doesn't select any rows, then nothing gets changed or supplied to INSERT.
But we don't have any access to your data, so we have no idea what it could (or should) do, and no way to test it.
So start by removing the INSERT code completely, and check what the SELECT part does in isolation - when it correctly returns the rows you want, you can start thinking about doing something else with the data!