anchor.diff:  			if (rs.isBeforeFirst())
   				sql = "UPDATE states_categories_total SET total = total + " + total  + "WHERE  state = '" + state  + "' AND cid = " + cid;
   			else
  -				sql = "INSERT INTO states_categories_total VALUES ('" + state + "', " + cid + ", " + total + ")";
  +				sql = "INSERT INTO states_categories_total (state, cid, total) VALUES ('" + state + "', " + cid + ", " + total + ")";
   
   				stmt.executeUpdate(sql);
   
  
positive.code: 			 if (rs.isBeforeFirst())
  			 	sql = "UPDATE products_total SET total = total + " + total  + "WHERE  pid = " + pid;
  			 else
  			 	sql = "INSERT INTO products_total VALUES (" + pid + ", " + total + ")";
  
  				stmt.executeUpdate(sql);
  				
  
negative.code: 		 if (rs.isBeforeFirst())
  		 	sql = "UPDATE states_total SET total = total + " + grandtotal + " WHERE  state = " + state;
  		 else
  		 	sql = "INSERT INTO states_total (state, total) VALUES ('" + state + "', " + grandtotal + ")";
  
  			stmt.executeUpdate(sql);
  		
  