Write to a memory tag from a database update

Does anyone know how to write a gateway script on a update from a database to write to a memory tag?

I’m not sure I understand your question. What’s writing to the memory tag? That can trigger a tag event or a tag change event script, which can then compute some update to your DB.

when I insert a new record of data I want to write a value in a certain column to a tag

You’ll have to repeatedly query the database to obtain any new information. Look at Query tags – you should be able to use an event triggered by one of those.