windows 10, emacs 26.1

I know that in org mode I can insert source code and execute them. Nice.

But what about sql:

Here in my.org file:

 #+name: some_query
   #+BEGIN_SRC sql
      SELECT * FROM invoice WHERE id IN (1,2,3)
   #+END_SRC

Is it possible to execute query direct in org mode and get result?

  • 2
    Yes: there is ob-sql.el and ob-sqlite.el. The latter is specific to sqlite but the former can handle different database engines. Read the beginning of ob-sql.el to see how to use it and check out also the SQL doc on Worg. – NickD Nov 29 at 17:18

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.