From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Vorobiev Subject: [Babel][R] Inclusion of multi-line named code blocks in R code Date: Wed, 18 Sep 2013 16:51:26 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=e89a8ff1c9a298928904e6af71e7 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:52201) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMPf5-0003u9-55 for emacs-orgmode@gnu.org; Wed, 18 Sep 2013 17:51:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VMPf2-0008P9-9V for emacs-orgmode@gnu.org; Wed, 18 Sep 2013 17:51:51 -0400 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]:45336) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VMPf2-0008P1-1p for emacs-orgmode@gnu.org; Wed, 18 Sep 2013 17:51:48 -0400 Received: by mail-pa0-f47.google.com with SMTP id kl13so8774635pab.6 for ; Wed, 18 Sep 2013 14:51:46 -0700 (PDT) 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 --e89a8ff1c9a298928904e6af71e7 Content-Type: text/plain; charset=ISO-8859-1 I have R code which submits SQL statements to a database server. Since the SQL is rather complex, I want to put it into a separate code block in order to have proper formatting, syntax highlighting, etc: #+name: long-sql #+begin_src sql select * from many, tables where complex_condition1 = 1, complex_condition2 = 2 #+end_src * Load the data to R session #+begin_src R :session *R* :noweb yes result <- submit_query('<>') #+end_src Unfortunately, the R block doesn't work. When I open the file generated by Babel, I see this: result <- submit_query('select * result <- submit_query('from many, tables etc instead of the one R submit_query call with my SQL statement as an argument. Is there anything I can do to achieve that? Thanks Alex --e89a8ff1c9a298928904e6af71e7 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable
I have R code which submits SQL statements to a database s= erver. Since the SQL is rather complex, I want to put it into a separate co= de block in order to have proper formatting, syntax highlighting, etc:

#+name: long-sql
#+begin_src sql
=A0 =A0= select *=A0
=A0 =A0 from many, tables
=A0 =A0 where
=A0 =A0 =A0 =A0 complex_condition1 =3D 1,
=A0 =A0 =A0 =A0= complex_condition2 =3D 2
#+end_src

* Load the data to R session
<= div>#+begin_src R :session *R* :noweb yes
=A0 =A0 result <- su= bmit_query('<<long-sql>>')
#+end_src

Unfortunately, the R block doesn't work. When I open the= file generated by Babel, I see this:

result <-= submit_query('select *
result <- submit_query('fr= om many, tables
etc

instead of the one R submit_query c= all with my SQL statement as an argument. Is there anything I can do to ach= ieve that?

Thanks
Alex

--e89a8ff1c9a298928904e6af71e7--