Delimiter //
/**
 * Credit limit data copy
 * @param int batchnum
 * @author Ben
 */
Drop Procedure If Exists LOADER_CREDITLIMIT_COPY//

Create Procedure LOADER_CREDITLIMIT_COPY (
    In batchnum Int
)
Begin

    Call LOADER_CREDITLIMIT_CREDITLIMIT_UPDATE(batchnum);

    Call CASH_AUTOINCREMENT_VALUE('CREDIT_LIMIT', @lastCreditLimitId);
    Call LOADER_CREDITLIMIT_CREDITLIMIT_INSERT(batchnum, @lastCreditLimitId);

End //

Delimiter ;