all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Robert Klein <roklein@roklein.de>
To: emacs-orgmode@gnu.org
Subject: Re: A strange problem with org-babel and SQLite
Date: Fri, 31 Aug 2018 11:17:25 +0200	[thread overview]
Message-ID: <20180831111725.3aeba880@lt70.mpip-mainz.mpg.de> (raw)
In-Reply-To: <CAG-LmmDd3Fkk8dL0gYiyDJfj1JAHArFNHaWWk=sU5y+eUtZ40Q@mail.gmail.com>

Hi Cecil,

On Fri, 31 Aug 2018 10:47:50 +0200
Cecil Westerhof <cldwesterhof@gmail.com> wrote:

> I have a strange problem with org-babel and SQLite.
> 
> I have a database that is created with:
>     CREATE TABLE "quotes" (
>         quoteID         TEXT           PRIMARY KEY,
>         quote           TEXT NOT NULL  UNIQUE,
>         lastUsed        TEXT,
>         totalUsed       INT  DEFAULT 'unused'
>     )
> 
> When using:
>     #+BEGIN_SRC sqlite :db ~/Twitter/twitter.sqlite :colnames yes
>     SELECT   lastUsed
>     ,        totalUsed
>     FROM     quotes
>     ORDER BY lastused  ASC
>     ,        totalUsed DESC
>     LIMIT    40
>     #+END_SRC
> 
> Everything is fine. But when I use (add the quote field in the
> select): #+BEGIN_SRC sqlite :db ~/Twitter/twitter.sqlite :colnames yes
>     SELECT   quote
>     ,        lastUsed
>     ,        totalUsed
>     FROM     quotes
>     ORDER BY lastused  ASC
>     ,        totalUsed DESC
>     LIMIT    40
>     #+END_SRC
> 
> I get:
>     executing Sqlite code block...
>     Wrote /tmp/babel-27920y_/ob-input-2792BTG
>     org-babel-read: End of file during parsing
> 
> What could be the problem?
> 

does it work outside of org/babel/emacs, that is, when you use the
query in a command line sqlite session, does it work?  “quote” is also
a function in sqlite, so this might be your issue.

Best regards
Robert

  reply	other threads:[~2018-08-31  9:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-31  8:47 A strange problem with org-babel and SQLite Cecil Westerhof
2018-08-31  9:17 ` Robert Klein [this message]
2018-08-31 10:24   ` Cecil Westerhof
2018-08-31 11:22     ` Robert Klein
2018-09-01  9:12       ` Cecil Westerhof
2018-09-01 12:24         ` Robert Klein
2018-09-02 13:22           ` Cecil Westerhof
2018-09-03  0:19             ` Cecil Westerhof
2018-09-03  1:09           ` Cecil Westerhof
2018-09-03  1:23             ` Cecil Westerhof
2018-09-05  6:56               ` Robert Klein
2018-09-09 12:36                 ` Robert Klein
2018-09-10  7:05                   ` Cecil Westerhof

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180831111725.3aeba880@lt70.mpip-mainz.mpg.de \
    --to=roklein@roklein.de \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.