[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[O] [PATCH] ob-sql.el: Add support for MS sqlcmd

From: Jonathan Leech-Pepin
Subject: [O] [PATCH] ob-sql.el: Add support for MS sqlcmd
Date: Thu, 4 Sep 2014 08:49:39 -0400

Patch provided inline and as attachment to ensure gmail does not mangle it.


ob-sql.el: Add support for sqlcmd

* lisp/ob-sql.el (org-babel-execute:sql): Add support for sqlcmd on
  Windows.  This is a replacement for osql.
 lisp/ob-sql.el |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/lisp/ob-sql.el b/lisp/ob-sql.el
index 7b85df8..e96d55d 100644
--- a/lisp/ob-sql.el
+++ b/lisp/ob-sql.el
@@ -116,6 +116,12 @@ This function is called by `org-babel-execute-src-block'."
                                      (or cmdline "")
                                      (org-babel-process-file-name in-file)
                                      (org-babel-process-file-name out-file)))
+            ('mssqlcmd (format "sqlcmd %s -S %s -s \"\t\" -i %s -o %s"
+                    (or cmdline "")
+                    dbhost
+                    (org-babel-process-file-name in-file)
+                    (org-babel-process-file-name
+                     out-file)))
                     ('mysql (format "mysql %s %s %s < %s > %s"
                     (dbstring-mysql dbhost dbuser dbpassword database)
                     (if colnames-p "" "-N")

Attachment: 0001-ob-sql.el-Add-support-for-sqlcmd.patch
Description: Binary data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]