Blogged by Ujihisa. Standard methods of programming and thoughts including Clojure, Vim, LLVM, Haskell, Ruby and Mathematics written by a Japanese programmer. github/ujihisa

Wednesday, October 27, 2010

Is Hash Comment in SQL?

A "#" is not the character to start a comment in SQL, but "--" is.

A "#" is the character to the end of the line in MySQL.

If you are a Vimmer and only use MySQL when you edit .sql files, you may want to regard the characters after #. .sql files are regarded as just SQL in Vim, but you can specify them as MySQL. Just to write the following one line on ~/.vim/ftdetect/mysql.vim.

autocmd BufRead,BufNewFile *.sql set filetype=mysql

No comments:

Post a Comment

Followers