From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Kitchin Subject: Re: Can I quote/ref value in the output table? Date: Tue, 12 Jul 2016 11:17:53 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11424360e28ff0053771c5f4 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54813) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMzRg-0002tL-70 for Emacs-orgmode@gnu.org; Tue, 12 Jul 2016 11:18:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bMzRb-0002vW-FY for Emacs-orgmode@gnu.org; Tue, 12 Jul 2016 11:18:00 -0400 Received: from mail-wm0-x233.google.com ([2a00:1450:400c:c09::233]:35155) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bMzRb-0002vK-8V for Emacs-orgmode@gnu.org; Tue, 12 Jul 2016 11:17:55 -0400 Received: by mail-wm0-x233.google.com with SMTP id f65so104030438wmi.0 for ; Tue, 12 Jul 2016 08:17:54 -0700 (PDT) In-Reply-To: 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" To: Xi Shen Cc: "emacs-orgmode@gnu.org" --001a11424360e28ff0053771c5f4 Content-Type: text/plain; charset=UTF-8 Do you mean something like this (I used an elisp block instead of a sql block, but hopefully you get the idea): #+name: src-block1 #+BEGIN_SRC emacs-lisp '((1 2) (3 4)) #+END_SRC #+RESULTS: src-block1 | 1 | 2 | | 3 | 4 | #+BEGIN_SRC python :var data=src-block1 print data #+END_SRC #+RESULTS: : [[1, 2], [3, 4]] If so, give your sql block a name, and use it as a variable in some other block. John ----------------------------------- Professor John Kitchin Doherty Hall A207F Department of Chemical Engineering Carnegie Mellon University Pittsburgh, PA 15213 412-268-7803 @johnkitchin http://kitchingroup.cheme.cmu.edu On Tue, Jul 12, 2016 at 3:59 AM, Xi Shen wrote: > Hi, > > Say I have a sql babel block which outputs a table. Is there any way > that I can reference the values in the output table in another babel > block? > > --001a11424360e28ff0053771c5f4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Do you mean something like this (I used an elisp bloc= k instead of a sql block, but hopefully you get the idea):

#+name: s= rc-block1
#+BEGIN_SRC emacs-lisp
'((1 2) (3 4))
#+END_SRC
<= br>#+RESULTS: src-block1
| 1 | 2 |
| 3 | 4 |

#+BEGIN_SRC pytho= n :var data=3Dsrc-block1
print data
#+END_SRC

#+RESULTS:
: = [[1, 2], [3, 4]]



If so, give your sql block a name, an= d use it as a variable in some other block.

John

---= --------------------------------
Professor John Kitchin=C2=A0
Doherty= Hall A207F
Department of Chemical Engineering
Carnegie Mellon Univer= sity
Pittsburgh, PA 15213
412-268-7803

On Tue, Jul 12, 2016 at 3:59 AM, Xi Shen <davidshen84@gmail.com> wrote:
Hi,

Say I have a sql babel block which outputs a table. Is there any way
that I can reference the values in the output table in another babel
block?


--001a11424360e28ff0053771c5f4--