Fixed sql placement.
Fenix API: fix compiling errors.