Loading

INSERT trigger

  1. /* If we are in a field, update the harvested area for that field REF: BE002-191 */
  2. IF(field_id_ IS NOT NULL) THEN
  3.   SELECT ROUND(SUM(dist_since_last_report),2) INTO distance_in_meters_ FROM eventdata WHERE astra_input_mask = 111 AND field_id = field_id_;
  4.   UPDATE gts_hectare_birdseye_fields.fields SET area_harvested = ROUND(((distance_in_meters_ * 3.2) * 0.0001),2) WHERE field_id = field_id_;
  5. END IF;

Comments