From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eric Schulte Subject: Re: babel: setting :cmdline header arg for sql blocks Date: Sun, 03 Feb 2013 15:47:18 -0700 Message-ID: <87zjzlf1pm.fsf@gmail.com> References: Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([208.118.235.92]:57553) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U28S7-0000OL-9r for emacs-orgmode@gnu.org; Sun, 03 Feb 2013 17:54:24 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1U28S6-0000oE-5H for emacs-orgmode@gnu.org; Sun, 03 Feb 2013 17:54:23 -0500 Received: from mail-pb0-f47.google.com ([209.85.160.47]:58198) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1U28S5-0000o2-Up for emacs-orgmode@gnu.org; Sun, 03 Feb 2013 17:54:22 -0500 Received: by mail-pb0-f47.google.com with SMTP id rp8so2855561pbb.20 for ; Sun, 03 Feb 2013 14:54:20 -0800 (PST) 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Gary Oberbrunner Cc: Orgmode Mailing List Gary Oberbrunner writes: > To run mysql code in org-mode (which by the way is pretty incredible that > this works at all, and so beautifully, especially since I'm on Windows), I > have to have a long header: > > #+BEGIN_SRC sql :exports both :results value :engine mysql :cmdline -h > XXX.YYY.XXX.YYY -u user -ppassword -D database > > I'd like to put all those flags in one place so I only need to say > #+BEGIN_SRC sql (and maybe the exports/results). If I put them in > PROPERTY tags at the end of the buffer: > > #+PROPERTY: exports both > #+PROPERTY: results value > #+PROPERTY: engine mysql > #+PROPERTY: cmdline -h XXX.YYY.XXX.YYY -u user -ppassword -D database > > then exporting no longer works, I presume because the exporter doesn't like > :cmdline or :exports or :results or something else about me setting these > globally. > > Is there a way to set them for sql blocks only? Or some kind of macro I > can use to tidy up my sql blocks? > > (I'm running recent git org-mode from a couple of weeks ago, Emacs > 24.3.50.1, Windows) You could customize the `org-babel-default-header-args:sql' variable. Cheers, -- Eric Schulte http://cs.unm.edu/~eschulte