emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] Is it possible to pass variable to variables of src block?


From: Michael Welle
Subject: Re: [O] Is it possible to pass variable to variables of src block?
Date: Wed, 06 Dec 2017 10:31:06 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3.50 (gnu/linux)

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]