Fix constant id value for variable in query