Delimiter //
/**
 * Check that Account Ref is not null
 *
 * @param int batchnum
 * @return void
 * @author Ben
 */
Drop Procedure if exists LOADER_GUARANTEED_NORMALIZE_ACCOUNT_REF_NOT_NULL //
Create Procedure LOADER_GUARANTEED_NORMALIZE_ACCOUNT_REF_NOT_NULL (
    In batchnum int
)
Begin
    Set @flagCountField='LOADER_GUARANTEED_ERRCOUNT';
    Set @flagMsgField='LOADER_GUARANTEED_ERRMSGS';
    Set @lastStatusField=null;
    Set @lastStatus=null;
    Set @checkedFieldName = 'ACCOUNTS_REF';

    CALL LOADER_CHECK_NULL (
        'LOADER_GUARANTEED'
        , @checkedFieldName
        , 'LOADER_GUARANTEED_BATCH_NUM'
        , batchnum
        , @flagCountField
        , @flagMsgField
        , @lastStatusField
        , @lastStatus
    );
End //
Delimiter ;