I would like to feed python output to sqlite input as below:

#+NAME: sqlcmd
#+begin_src python :results output
print("select * from tablename")

#+RESULTS: sqlcmd
: select * from tablename

#+begin_src sqlite :db /media/sf_work/a.db -header -column :var sqlcmd=sqlcmd :results output

It not work now.

What's proper way to use sql command output from python script?

1 Answer 1


Read C-hig (org)Noweb Reference Syntax


#+NAME: foo
#+BEGIN_SRC emacs-lisp :results verbatim
'(+ 1 2)

#+RESULTS: foo
: (+ 1 2)

#+BEGIN_SRC emacs-lisp :noweb yes :results verbatim

: 3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.