In this paper we study genericity for the following parameterized class of nonlinear programs: \begin{eqnarray*} \textrm{minimize } f_u(x) := f(x) - \langle u, x \rangle \quad \textrm{subject to } \quad x \in S, \end{eqnarray*} where $f \colon \mathbb{R}^n \rightarrow \mathbb{R}$ is a polynomial function and $S \subset \mathbb{R}^n$ is a closed semialgebraic set, which is not necessarily compact. Assume that the constraint set $S$ is regular. It is shown that there exists an open and dense semialgebraic set $\mathscr{U} \subset \mathbb{R}^n$ such that for any $\bar{u} \in \mathscr{U},$ if the corresponding function $f_{\bar{u}}$ is bounded from below on $S,$ then for all vectors $u \in \mathbb{R}^n,$ sufficiently close to $\bar{u},$ the problem $\min_{x \in S} f_u(x)$ has the following properties: the objective function $f_u$ is coercive on the constraint set $S,$ there is a unique optimal solution, lying on a unique active manifold, and for which the strong second-order sufficient conditions, the quadratic growth condition, and the global sharp minima hold. Further, the active manifold is constant, and the optimal solution and the optimal value function vary analytically under local perturbations of the objective function. As a consequence, for almost all polynomial optimization problems, we can find a natural sequence of computationally feasible semidefinite programs, whose solutions give rise to a sequence of points in $\mathbb{R}^n$ converging to the optimal solution of the original problem.