emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] ob-sql.el: Add support for MS sqlcmd
@ 2014-09-04 12:49 Jonathan Leech-Pepin
  0 siblings, 0 replies; only message in thread
From: Jonathan Leech-Pepin @ 2014-09-04 12:49 UTC (permalink / raw)
  To: Org Mode Mailing List


[-- Attachment #1.1: Type: text/plain, Size: 1207 bytes --]

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

Regards,
Jonathan



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")
-- 
1.7.9

[-- Attachment #1.2: Type: text/html, Size: 1741 bytes --]

[-- Attachment #2: 0001-ob-sql.el-Add-support-for-sqlcmd.patch --]
[-- Type: application/octet-stream, Size: 1204 bytes --]

From f26188c0f42002867d0338e2be949146a2e974b7 Mon Sep 17 00:00:00 2001
From: Jonathan Leech-Pepin <jonathan.leechpepin@gmail.com>
Date: Thu, 4 Sep 2014 08:44:47 -0400
Subject: [PATCH] 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")
-- 
1.7.9


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-09-04 12:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-04 12:49 [PATCH] ob-sql.el: Add support for MS sqlcmd Jonathan Leech-Pepin

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).