|
From: | Xi Shen |
Subject: | Re: [O] Is it possible to pass variable to variables of src block? |
Date: | Tue, 12 Dec 2017 06:30:01 +0000 |
Hello,
Xi Shen <address@hidden> writes:
> Hi,
>
> http://orgmode.org/manual/var.html
>
> This wiki explains how to use variable inside a src block. But I wonder if
> it is possible to specify variable to the variables in the src definition.
>
> E.g. for the sql src block, I want to execute a script on different server.
> I want to define a variable for the ":dbhost" variable.
did you think about something like this?
(setq hmw/dbhost "db1")
#+BEGIN_SRC sql :dbhost (symbol-value 'hmw/dbhost) :dbuser weather :database environment :engine postgresql
select time, temperature from weather limit 20;
#+END_SRC
Regards
hmw
[Prev in Thread] | Current Thread | [Next in Thread] |