summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Frankel <rick@rickster.com>2013-03-19 20:51:42 (GMT)
committer Rick Frankel <rick@rickster.com>2013-03-19 20:51:42 (GMT)
commit78b3a0398124aff412606438b851f315078485e4 (patch)
tree32bf8d78fe14e453d6b0c19f0d1db7ff118c674a
parenteff59a15d76647ce8282626b9eb463dc3706d56e (diff)
downloadorg-mode-78b3a0398124aff412606438b851f315078485e4.zip
org-mode-78b3a0398124aff412606438b851f315078485e4.tar.gz
Fix issue with dbi processing in ob-sql.
* lisp/ob-sql.el (org-babel-execute:sql): Unquote cmdline argument in format string, dbish requires three separate arguments. Add dbi to the list of engines with automatically added header separator.
-rw-r--r--lisp/ob-sql.el5
1 files changed, 3 insertions, 2 deletions
diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index 20e62d0..264ed99 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -103,10 +103,10 @@ This function is called by `org-babel-execute-src-block'."
(org-babel-temp-file "sql-out-")))
(header-delim "")
(command (case (intern engine)
- ('dbi (format "dbish --batch '%s' < %s | sed '%s' > %s"
+ ('dbi (format "dbish --batch %s < %s | sed '%s' > %s"
(or cmdline "")
(org-babel-process-file-name in-file)
- "/^+/d;s/^\|//;$d"
+ "/^+/d;s/^\|//;s/(NULL)/ /g;$d"
(org-babel-process-file-name out-file)))
('monetdb (format "mclient -f tab %s < %s > %s"
(or cmdline "")
@@ -142,6 +142,7 @@ This function is called by `org-babel-execute-src-block'."
(with-temp-buffer
(cond
((or (eq (intern engine) 'mysql)
+ (eq (intern engine) 'dbi))
(eq (intern engine) 'postgresql))
;; Add header row delimiter after column-names header in first line
(cond