How can we execute using Golang multiple update statements like
UPDATE $userName SET P1 = '$p1MON' WHERE day = 'MON1';
UPDATE $userName SET P1 = '$p1TUE' WHERE day = 'TUE1';
UPDATE $userName SET P1 = '$p1WED' WHERE day = 'WED1'
I know, we can db.prepare for multiple insert statements, wondering about update statuements
The standard package doesn’t provide you advanced features of ORM or a driver library. You can use bulk updates provided by your driver library.
I don’t know which database you are using at the moment but I am assuming it is postgreSQL. With a driver library, you can easily do your bulk updates.
I have also found the raw SQL to generate a bulk update so you can use it within database/sql if you do not wish to use a driver library
Additional note: db.prepare doesn’t make you have bulk insert out of the box. It’s sole purpose is to have a transaction ongoing for your database.