In a PostgreSQL procedure, a variable QUERY of type varchar2 holds a query string that is executed as
QUERY
varchar2
OPEN resultset FOR QUERY;