Yeah, this code is not complete, there is missing SELECT / ENDSELECT for starters.