as far as i can figure out from your statement...
there is some syntax error in the code where you have written SQL code..