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: Thu, 16 May 2013 13:11:12 -0600
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

Oliver Večerník <address@hidden> 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 test.sqlite < t1.sql
>
> #+BEGIN_SRC sh
> echo "ID|product"
> sqlite3 test.sqlite "
>   SELECT * from t1;
> "
> #+END_SRC
>
> #+RESULTS:
> | ID | product |     |
> |  1 | apple   | pie |
> |  2 | sugar   |     |
>

What about

#+BEGIN_SRC sqlite :csv :db test.sqlite
  SELECT * from t1;
#+END_SRC

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

-- 
Eric Schulte
http://cs.unm.edu/~eschulte



reply via email to

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