Delimiter //
/**
 *
 * @param int batchnum
 * @return void
*/
Drop Procedure if exists LOADER_MEMBERS_NORMALIZE_CONTACT_REF_IS_UNIQUE//

Create Procedure LOADER_MEMBERS_NORMALIZE_CONTACT_REF_IS_UNIQUE (
    In batchnum int
)
Begin
    Set @flagCountField='LOADER_MEMBERS_ERRCOUNT';
    Set @flagMsgField='LOADER_MEMBERS_ERRMSGS';
    Set @lastStatusField=null;
    Set @lastStatus=null;

    call LOADER_CHECK_UNIQUE (
	'LOADER_MEMBERS'
	, 'CONTACTS_REF'
	, null
	, 'LOADER_MEMBERS_BATCH_NUM'
	, batchnum
	, @flagCountField
        , @flagMsgField
        , @lastStatusField
        , @lastStatus
    );

End //

Delimiter ;