hql script variabilise

Variabalize hql script