I may have missed you spelling this out in a previous email, but can you
not import Org tables directly into sqlite code blocks?
Evaluate this again after evaluating the second block.
#+BEGIN_SRC sqlite :csv :db test.sqlite
SELECT * from t1;
#+END_SRC
This works like a charm, thanks
Oliver Večerník o...@vecernik.at writes:
I may have missed you spelling this out in a previous email, but can you
not import Org tables directly into sqlite code blocks?
Evaluate this again after evaluating the second block.
#+BEGIN_SRC sqlite :csv :db test.sqlite
SELECT * from t1;
Oliver Večerník o...@vecernik.at writes:
2. use :results drawer, and explicitly formatting the results in
Org-mode syntax w/awk
Unfortunately this doesn't work. The output is always printed to the
#+RESULTS: section and not piped through awk. But working with
:results raw works perfect
Hi,
I've got a small test case which I believe is a bug:
$ cat t1.sql
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE t1(id integer,product text);
INSERT INTO t1 VALUES(1,'apple pie');
INSERT INTO t1 VALUES(2,'sugar');
COMMIT;
sqlite3 test.sqlite t1.sql
#+BEGIN_SRC sh
echo ID|product
Oliver Večerník o...@vecernik.at writes:
Hi,
I've got a small test case which I believe is a bug:
$ cat t1.sql
PRAGMA foreign_keys=OFF;
BEGIN TRANSACTION;
CREATE TABLE t1(id integer,product text);
INSERT INTO t1 VALUES(1,'apple pie');
INSERT INTO t1 VALUES(2,'sugar');
COMMIT;
sqlite3
Eric Schulte schulte.e...@gmail.com writes:
What about
#+BEGIN_SRC sqlite :csv :db test.sqlite
SELECT * from t1;
#+END_SRC
#+RESULTS:
| 1 | apple pie |
| 2 | sugar |
I needed some calculations and format tweaking with awk which I piped
the results. That is why I choose the shell.
Oliver Večerník o...@vecernik.at writes:
Eric Schulte schulte.e...@gmail.com writes:
What about
#+BEGIN_SRC sqlite :csv :db test.sqlite
SELECT * from t1;
#+END_SRC
#+RESULTS:
| 1 | apple pie |
| 2 | sugar |
I needed some calculations and format tweaking with awk which I piped
Eric Schulte schulte.e...@gmail.com writes:
In that case I'd suggest either
1. adding :separator support to ob-sh.el, so that you can specify a
different results separator to be passed to
`org-babel-import-elisp-from-file'
or
2. use :results drawer, and explicitly formatting the
2. use :results drawer, and explicitly formatting the results in
Org-mode syntax w/awk
Unfortunately this doesn't work. The output is always printed to the
#+RESULTS: section and not piped through awk. But working with
:results raw works perfect for me. I can even produce a separator
line