Skip to content

Commit

Permalink
Merge pull request #162 from carapai/master
Browse files Browse the repository at this point in the history
Added line to delete null or empty person attributes
  • Loading branch information
ssmusoke authored Nov 2, 2016
2 parents 93295d3 + ec39702 commit e43056d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,9 @@ CREATE DEFINER=`openmrs`@`localhost` PROCEDURE `transfer`()

UPDATE openmrs.person_address AS c1, openmrs_backup.person_address AS c2 SET c1.state_province = c2.subregion,c1.address4 = c2.neighborhood_cell,c1.address3 = c2.township_division WHERE c1.person_address_id = c2.person_address_id AND c1.person_id = c2.person_id ;

-- Deleting attributes with null or empty values

DELETE FROM person_attribute WHERE `value` IS NULL OR `value`='';

END$$
DELIMITER ;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ CREATE DEFINER=`openmrs`@`localhost` PROCEDURE `transfer`()

UPDATE openmrs.person_address AS c1, openmrs_backup.person_address AS c2 SET c1.address5 = c2.address3,c1.address4 = c2.address4,c1.address3 = c2.address5 WHERE c1.person_address_id = c2.person_address_id AND c1.person_id = c2.person_id ;

-- Deleting attributes with null or empty values
DELETE FROM person_attribute WHERE `value` IS NULL OR `value`='';


END$$
DELIMITER ;
Expand Down

0 comments on commit e43056d

Please sign in to comment.