emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Error Embedding SQL Source from code block into R Source of Another (noweb)
@ 2014-09-30  0:39 Eric Brown
  2014-09-30  8:05 ` Rainer M Krug
  2014-09-30 15:08 ` Charles Berry
  0 siblings, 2 replies; 12+ messages in thread
From: Eric Brown @ 2014-09-30  0:39 UTC (permalink / raw)
  To: emacs-orgmode

Dear List:

It is possible to embed SQL code as a string to be evaluated in R. I am
interested in formatting the SQL code in its own source code block, with
its own syntax highlighting and editing mode (C-c ').

The first time I run the code, I am prompted for R starting directory,
but I get an error:

---
load ESSR: + + + Error: unexpected string constant in:
source('~/.emacs.d/elpa/ess-20140913.1153/etc/ESSR/R/.load.R',
local=TRUE) #define load.ESSR
load.ESSR('"
---

and the console locks.  I can C-g to get out of it, and then
re-evaluate, and the code prints what I expect -- the text of the SQL
command.

Is this the right way to go about this?  Have I discovered a bug, or
perhaps accidentally a wrong way to get the right answer?

Is this an ESS problem, and not an orgmode problem, per se?  My ESS
normally starts up fine, so I thought I would ask on this list first.

A minimal example (first failing, second evaluation giving expected
output) follows.

Best regards,

Eric

Debian GNU/Linux (jessie)
Emacs 24.3.93
Org current from org repo
ESS from MELPA (ca. 14.09)
R 3.1.1 compiled from source



----- SESSION -----
#+TITLE: Test SQL Code
#+AUTHOR: Eric Brown                                              
#+EMAIL: brown@fastmail.fm
#+PROPERTY: session *R*                                           
#+PROPERTY: cache no

#+name: sqlsource
#+begin_src sql :engine postgresql :eval yes :noweb-ref sqlsrc :exports code :results none
  select 
    * 
  from 
    t 
  limit 
    10
#+end_src

#+name: rsource
#+begin_src R :noweb yes :results output :exports both
  input <- '
  <<sqlsrc>>
  '
  cat(input)
  # dbGetQuery(connectionHandle, input)
#+end_src

#+RESULTS: rsource
: 
: select 
:   * 
: from 
:   t 
: limit 
:   10
---------------------

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2014-10-01 17:43 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-30  0:39 Error Embedding SQL Source from code block into R Source of Another (noweb) Eric Brown
2014-09-30  8:05 ` Rainer M Krug
2014-09-30 13:36   ` Grant Rettke
2014-09-30 14:32     ` Eric Brown
2014-09-30 18:46       ` Grant Rettke
2014-09-30 19:15       ` Nick Dokos
2014-09-30 23:16         ` Grant Rettke
2014-10-01  2:23           ` Nick Dokos
2014-10-01 17:23             ` Grant Rettke
2014-10-01 17:43               ` Nick Dokos
2014-09-30 15:08 ` Charles Berry
2014-09-30 17:02   ` Eric Brown

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).