emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] sqlite im-/export


From: Eric Schulte
Subject: Re: [O] sqlite im-/export
Date: Fri, 17 May 2013 07:54:53 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Oliver Večerník <address@hidden> 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 for me.  I can even produce a separator
> line in the table now with =print "|-"=.
>
> The only question left, how to import org tables "on the fly" to sqlite,
> to keep everthing in Org mode.  This would also be an interesting
> candidate for an "ob-doc-sh.org" starter I guess.

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

#+RESULTS:
| 1 | apple pie |
| 2 | sugar     |

A manually created Org-mode block.

#+name: manual
| 3 | rhubarb |
| 4 | butter  |

#+BEGIN_SRC sqlite :csv :var data=manual :db test.sqlite :results silent
  .separator ","
  .import $data t1
#+END_SRC
-- 
Eric Schulte
http://cs.unm.edu/~eschulte

reply via email to

[Prev in Thread] Current Thread [Next in Thread]