From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Welle Subject: Re: Is it possible to pass variable to variables of src block? Date: Wed, 06 Dec 2017 10:31:06 +0100 Message-ID: <877eu0gq3p.fsf@luisa.c0t0d0s0.de> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:42120) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eMW2t-0007Hp-GG for emacs-orgmode@gnu.org; Wed, 06 Dec 2017 04:31:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eMW2p-00014j-H2 for emacs-orgmode@gnu.org; Wed, 06 Dec 2017 04:31:15 -0500 Received: from mout.gmx.net ([212.227.17.20]:59535) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eMW2p-000137-7H for emacs-orgmode@gnu.org; Wed, 06 Dec 2017 04:31:11 -0500 Received: from stella.c0t0d0s0.de ([194.95.66.1]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0M09Ee-1fEL321nw4-00uFTx for ; Wed, 06 Dec 2017 10:31:08 +0100 Received: from Stella (stella.c0t0d0s0.de [192.168.42.1]) by stella.c0t0d0s0.de (Postfix) with ESMTP id 55FD7C419C for ; Wed, 6 Dec 2017 10:31:06 +0100 (CET) In-Reply-To: (Xi Shen's message of "Tue, 05 Dec 2017 05:19:28 +0000") 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: emacs-orgmode@gnu.org Hello, Xi Shen 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