Delimiter //
/**
check if accounts ref is not null
**/
Drop Procedure if exists LOADER_REFDATA_NORMALIZE_ACCOUNT_REF_NOT_NULL //
Create Procedure LOADER_REFDATA_NORMALIZE_ACCOUNT_REF_NOT_NULL (
    In batchnum int
)
Begin
    Set @flagCountField='LOADER_REFDATA_ERRCOUNT';
    Set @flagMsgField='LOADER_REFDATA_ERRMSGS';
    Set @lastStatusField=null;
    Set @lastStatus=null;
    Set @checkedFieldName = 'ACCOUNTS_REF';

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