3 ms·
It's also worth mentioning that SQL can be evaluated in a code block - as well as a bunch of other languages, but SQL would be pertinent for this example: #+
by kagevf 4y ago
It's also worth mentioning that SQL can be evaluated in a code block - as well as a bunch of other languages, but SQL would be pertinent for this example:
#+name: my-query
#+header: :engine mssql
#+header: :dbhost DBServer
#+header: :Trusted_Connection True
#+header: :database DBName
#+begin_src sql
select top 3 id, name, description
from dbo.Foo
#+end_src
#+RESULTS: my-query
| id | name | description |
|----+------------+-------------|
| 1 | Name one | abc |
| 2 | Name two | xyz |
| 3 | Name three | 123 |
My example uses MS Sql Server, but of course emacs supports a lot more databases.