more sql syntax fixes

end and start a protected words in sql so we need to quote them
Syntax Fixing
Syntax fix

4
Wrapper fix

got wrong logic for static call function...