Delimiter //
/**
 * Checks if the contact's last name is in uppercase
 *
 * @param int batchnum
 * @return void
 * @author Jean-François
 * @ticket #3786
 */
Drop Procedure if exists LOADER_CONTACTS_NORMALIZE_CONTACTS_CHECK_LAST_NAME_UPPERCASE//

Create Procedure LOADER_CONTACTS_NORMALIZE_CONTACTS_CHECK_LAST_NAME_UPPERCASE (
    In batchnum int
)
Begin
    
    main: begin
		
		call LOADER_BUILD_CONTACTS_CHECK_BASE_QUERY ('CONTACTS_INDIVIDUAL_LAST_NAME',
                    batchnum, 
                    'Texte de champ non majuscule', 
                    null, 0,
                    @query
            );

        set @query = Concat(@query, ' And UPPER(LOADER_CONTACTS.CONTACTS_INDIVIDUAL_LAST_NAME) collate utf8_bin ', 
                                    ' != LOADER_CONTACTS.CONTACTS_INDIVIDUAL_LAST_NAME collate utf8_bin');

        PREPARE stmt FROM @query;
		execute stmt			
			;
		Deallocate prepare stmt;


    end ;

End //

Delimiter ;
