Delimiter //
/**
check if ENTITIES_REF_SEQUENCE is not null
**/
Drop Procedure if exists LOADER_REFDATALABEL_NORMALIZE_ENTITIES_REF_SEQUENCE_NOT_NULL //
Create Procedure LOADER_REFDATALABEL_NORMALIZE_ENTITIES_REF_SEQUENCE_NOT_NULL (
    In batchnum int
)
Begin
    Set @flagCountField='LOADER_REFDATALABEL_ERRCOUNT';
    Set @flagMsgField='LOADER_REFDATALABEL_ERRMSGS';
    Set @lastStatusField=null;
    Set @lastStatus=null;
    Set @checkedFieldName = 'ENTITIES_REF_SEQUENCE';

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