Oliver Večerník 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;
>> #+END_SR
> 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, thank
Oliver Večerník 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 fo
> 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 separat
Eric Schulte 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 results in
>
Oliver Večerník writes:
> Eric Schulte 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
Eric Schulte 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. In this case
Oliver Večerník 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 t
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|pro