8

I use R interactively from Org-mode - the keybinding C-x ' from within an R code-block launches an interactive R session using ESS.

When I press C-x ' from inside an SQL code block, it sends the code block to an SQL-mode buffer, but it is not clear how I can then send a query to MySQL.

Can I do this with MySQL?

David LeBauer
  • 31,011
  • 31
  • 115
  • 189
  • related: http://stackoverflow.com/questions/8772032/configuring-custom-groups-in-my-cnf, http://stackoverflow.com/q/5734965/199217 – David LeBauer Apr 05 '12 at 15:33

1 Answers1

5

First, include the code from the accepted answer to How can I get emacs sql-mode to use the mysql config file (.my.cnf)? in your .emacs

Second, use C-x ' from within the SQL code block to send the code block to an SQL mode buffer

Once the code block has been sent to a buffer in SQL mode, launch your MySQL session using M-x pool-a (or whatever connection you wish to use).

At this point, the standard SQL keybindings can be used:

C-c C-c send paragraph
C-c C-r send selected region
C-c C-b send entire buffer
C-c C-s send string
Community
  • 1
  • 1
Abe
  • 12,956
  • 12
  • 51
  • 72