Aloha all,

Is it possible to define frequently used code snippets in a generic way so they can be used in different sessions?

Something like this is what I have in mind:

#+srcname: r-connect
#+begin_src R :exports none :session any
library(rMySQL)
con <- dbConnect(MySQL(), user="user_name", password="password",
                     dbname="db_name", host="host_name")
#+end_src

#+srcname: r-query
#+begin_src R :session session-1
# <<r-connect>>
res <- dbGetQuery(con, "select * from table_name where 1")
#+end_src

Tom

Thomas S. Dye, Ph.D.
T. S. Dye & Colleagues, Archaeologists, Inc.
Phone: (808) 529-0866 Fax: (808) 529-0884
http://www.tsdye.com


_______________________________________________
Emacs-orgmode mailing list
Remember: use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to