Implementing auto gen key returning and record count