Stored procedures used in getting the number of generations of a germplasm (executed when creating new program)

Issue: GCP-8008

Reviewer: Dan V (post-commit)