t714 undid the formatting---it is causing lots of conflicts with resolved otherwise
t714 added a logic to decide for update and insrt baswd on measureId>-1 also