script-friendly prepare statement