Re: [O] A strange problem with org-babel and SQLite

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: [O] A strange problem with org-babel and SQLite

Cecil Westerhof-5
2018-08-31 11:17 GMT+02:00 Robert Klein <[hidden email]>:

> Hi Cecil,
>
> On Fri, 31 Aug 2018 10:47:50 +0200
> Cecil Westerhof <[hidden email]> 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.
>

Yes, in sqlite3 and sqlitebrowser it works without problems.
In org-babel even 'SELECT *' goes wrong.

--
Cecil Westerhof
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: [O] A strange problem with org-babel and SQLite

Cecil Westerhof-5
Oops, wrong group. Sorry. :'-(

2018-08-31 12:21 GMT+02:00 Cecil Westerhof <[hidden email]>:

> 2018-08-31 11:17 GMT+02:00 Robert Klein <[hidden email]>:
>
>> Hi Cecil,
>>
>> On Fri, 31 Aug 2018 10:47:50 +0200
>> Cecil Westerhof <[hidden email]> 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.
>>
>
> Yes, in sqlite3 and sqlitebrowser it works without problems.
> In org-babel even 'SELECT *' goes wrong.
>
> --
> Cecil Westerhof
>



--
Cecil Westerhof
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users