From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Brown Subject: Error Embedding SQL Source from code block into R Source of Another (noweb) Date: Mon, 29 Sep 2014 19:39:30 -0500 Message-ID: <87lhp2x7p9.fsf@air.ben-zion.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:33499) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYlTk-0006xs-4I for emacs-orgmode@gnu.org; Mon, 29 Sep 2014 20:39:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XYlTe-0000mf-Ap for emacs-orgmode@gnu.org; Mon, 29 Sep 2014 20:39:44 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:50126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XYlTe-0000lM-1O for emacs-orgmode@gnu.org; Mon, 29 Sep 2014 20:39:38 -0400 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by gateway2.nyi.internal (Postfix) with ESMTP id C787E2054E for ; Mon, 29 Sep 2014 20:39:31 -0400 (EDT) Received: from air.ben-zion.org (unknown [50.158.169.145]) by mail.messagingengine.com (Postfix) with ESMTPA id 67A8F6800CD for ; Mon, 29 Sep 2014 20:39:31 -0400 (EDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org 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 <- ' <> ' cat(input) # dbGetQuery(connectionHandle, input) #+end_src #+RESULTS: rsource : : select : * : from : t : limit : 10 ---------------------