From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joost Helberg Subject: ob-sql error because of not specifying column-seperator Date: Fri, 03 Dec 2010 14:01:55 +0100 (CET) Message-ID: <20101203.140155.105952638.joost@snow.nl> Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=34896 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1POVGx-00069Z-Pb for emacs-orgmode@gnu.org; Fri, 03 Dec 2010 08:02:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1POVGw-0003pA-Gi for emacs-orgmode@gnu.org; Fri, 03 Dec 2010 08:01:59 -0500 Received: from mx.snow.nl ([213.154.248.146]:47942) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1POVGw-0003ow-An for emacs-orgmode@gnu.org; Fri, 03 Dec 2010 08:01:58 -0500 Received: from intern.snow.nl (neerijnen.snow.nl [213.154.248.134]) by mx.snow.nl (Postfix) with ESMTP id E77EC40181 for ; Fri, 3 Dec 2010 14:01:55 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by intern.snow.nl (Postfix) with ESMTP id AB7C0F0200 for ; Fri, 3 Dec 2010 14:01:55 +0100 (CET) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Hi, when using babel SQL, the column's in the resultset are converted to org-tables using (org-table-import file sep). The command used to retrieve the information from the databaseserver gets the option to use the tab (\t) as columnseperator. The call to org-table-import however doesn't specify this seperator. This leaves it to org-table-import to find out what the seperator is. org-table-import doesn't always succeed in this. Hence the diff below which sets the seperator to (\t). regards, Joost Helberg diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el index 19c271d..6bb9a96 100644 --- a/lisp/ob-sql.el +++ b/lisp/ob-sql.el @@ -80,7 +80,7 @@ This function is called by `org-babel-execute-src-block'." (message command) (shell-command command) (with-temp-buffer - (org-table-import out-file nil) + (org-table-import out-file '(16)) (org-babel-reassemble-table (org-table-to-lisp) (org-babel-pick-name (cdr (assoc :colname-names params)) -- Snow B.V. http://snow.nl