From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: SQL support in Babel Date: Thu, 20 Nov 2014 23:35:50 -0500 Message-ID: <87wq6pdvbt.fsf@pierrot.dokosmarshall.org> References: <87vbm9hp5j.fsf@net82.ceos.umanitoba.ca> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:48271) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xrfx4-0000Ue-Hc for emacs-orgmode@gnu.org; Thu, 20 Nov 2014 23:36:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Xrfwy-0001CW-Bi for emacs-orgmode@gnu.org; Thu, 20 Nov 2014 23:36:10 -0500 Received: from plane.gmane.org ([80.91.229.3]:33002) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Xrfwy-0001CQ-5J for emacs-orgmode@gnu.org; Thu, 20 Nov 2014 23:36:04 -0500 Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1Xrfwu-0000fN-VR for emacs-orgmode@gnu.org; Fri, 21 Nov 2014 05:36:00 +0100 Received: from pool-108-20-41-17.bstnma.fios.verizon.net ([108.20.41.17]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 21 Nov 2014 05:36:00 +0100 Received: from ndokos by pool-108-20-41-17.bstnma.fios.verizon.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 21 Nov 2014 05:36:00 +0100 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: emacs-orgmode@gnu.org Seb writes: > Hi, > > The last code block in ob-doc-sql¹ suggests I should be able to place a > number of #+HEADER lines above my SQL source code to specify the > connection string. I am trying to connect to a remote PostgreSQL > server, and after lots of experimentation, the only way this works for > me is to have a single #+HEADER line with a :cmdline with the entire > connection string. All the other header arguments (:database, :dbuser, > etc.), whether in separate lines or in a single one, seem to be > completely ignored. Using Org 8.2.10 and Emacs 24.4.1 from Debian Sid > packages. Is this a problem with this version combination, or does the > functionality of the header arguments depend on the engine being used? > Thanks. > > > +--- Footnotes ---+ > ¹ http://orgmode.org/worg/org-contrib/babel/languages/ob-doc-sql.html FWIW, the following worked fine for me: #+name: my-query #+header: :engine postgresql #+header: :dbhost #+header: :dbuser #+header: :dbpassword #+header: :database sheetmusic #+begin_src sql SELECT id, creator, title, category, boxnumber FROM music WHERE id > 300; #+end_src #+RESULTS: my-query | # -*- coding: utf-8 -*- | | | | | | id | creator | title | category | boxnumber | |-------------------------+---------+-------------------------------------------------------------------+-----------+-----------| | 387 | 92 | Lullay my Liking | Christmas | 101 | | 397 | 303 | Te Deum in B minor | General | 314 | | ... GNU Emacs 24.4.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.10.9) of 2014-08-11 Org-mode version 8.3beta (release_8.3beta-559-g43ca1f @ /home/nick/elisp/org-mode/lisp/) -- Nick