saving each record entry to db