Function: sql-mode

Major mode to edit SQL.

You can send SQL statements to the SQLi buffer using
M-x sql-send-region. Such a buffer must exist before you can do this.
See `sql-help' on how to create SQLi buffers.


Uses keymap `sql-mode-map', which is not currently defined.

Customization: Entry to this mode runs the `sql-mode-hook'.

When you put a buffer in SQL mode, the buffer stores the last SQLi
buffer created as its destination in the variable `sql-buffer'. This
will be the buffer M-x sql-send-region sends the region to. If this
SQLi buffer is killed, M-x sql-send-region is no longer able to
determine where the strings should be sent to. You can set the
value of `sql-buffer' using M-x sql-set-sqli-buffer.

For information on how to create multiple SQLi buffers, see
`sql-interactive-mode'.

Note that SQL doesn't have an escape character unless you specify
one. If you specify backslash as escape character in SQL, you
must tell Emacs. Here's how to do that in your init file:

(add-hook 'sql-mode-hook (lambda () (modify-syntax-entry ?\\ "." sql-mode-syntax-table))) (fn)