Ranjana Ghimire has it right. I run into this all the time. Any previous statement before the "WITH" needs to be ended with a semi-colon.