help-gnu-emacs
[Top][All Lists]
Advanced

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

RE: sqlserver patch for Bable?


From: Subhan Michael Tindall
Subject: RE: sqlserver patch for Bable?
Date: Fri, 19 Sep 2014 21:00:29 +0000

OK, I've almost got this.  By modifying the msosql (deprecated) command I've 
gotten pretty close.
I hard-coded some server info for ease of testing, the connection seems to be 
working fine.
Then I had to track down & correct a problem with the temporary file names.
I'm on a windows system & it appears that something in the processing stream 
was mangling the temp file names by adding an escape before the colon like this:
C:-> C\:
Which was causing a fail.
Fixed this by changing 'Temporary File Directory' to ~/temp 
Now, however, I get the following errors:

(ob-sql.el )
                    ('msosql (format "osql %s -s \"\t\" -i %s -o %s"
                                     (or cmdline "")
                                     (org-babel-process-file-name in-file)
                                     (org-babel-process-file-name out-file)))
;;following is what I added, above is what existed already. Osql is deprecated 
as a CLI to sqlserver
        ('mssqlcmd (format "sqlcmd %s -S FCSQLSVR3 -d PHTStaging -s \"\t\" -i 
%s -o %s"
                   (or cmdline "")
                   (org-babel-process-file-name in-file)
                   (org-babel-process-file-name out-file)))


#+BEGIN_SRC sql :engine mssqlcmd
select count(*) from referral
#+END_SRC

When evaluated, *Org-Babel Error Output* gets:
Sqlcmd: Error: '-' or '/' does not have an associated argument.
Enter '-?' for help.
And the message buffer holds
executing Sql code block...
sqlcmd  -S FCSQLSVR3 -d PHTStaging -s " " -i 
//fcfpsvr2/redir/Desktop/subhant/Desktop/home/temp/sql-in-12936ui1 -o 
//fcfpsvr2/redir/Desktop/subhant/Desktop/home/temp/sql-out-12936gsE
Wrote //fcfpsvr2/redir/Desktop/subhant/Desktop/home/temp/ob-input-12936t2K
Babel evaluation exited with code 1

The in file holds the query as expected
The out file is empty
The fie ob-input-12936t2K does not exist

Any ideas where to look from here?


> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On
> Behalf Of Subhan Michael Tindall
> Sent: Friday, September 19, 2014 10:35 AM
> To: address@hidden
> Subject: sqlserver patch for Bable?
> 
> Does anyone have a working patch to use MS SQL Server as a back end for
> SQL code blocks?
> I'm stuck on a windows box, and would like to do some literate programming
> combining some R analysis and data pulled from a sqlserver database
> accessed using my windows credentials.
> I've got it working (for what it's worth) in sql-ms mode if that helps.
> I'm hoping someone's already done the work, although I don't think it's
> extreme (I patched for sql*plus/oracle in the past) Thanks!
> Subhan
> 
> 
> Subhan Michael Tindall
> Program Analyst - FamilyCare Health Plans
> 825 NE Multnomah St, Suite 1400; Portland OR 97232
> Direct: 503-471-3127
> Fax:      503-471-3177
> Email:  address@hidden<mailto:address@hidden>
> [Email-Signature-Logos June 20143]
> 
> 
> This message is intended for the sole use of the individual and entity to
> which it is addressed and may contain information that is privileged,
> confidential and exempt from disclosure under applicable law. If you are not
> the intended addressee, nor authorized to receive for the intended
> addressee, you are hereby notified that you may not use, copy, disclose or
> distribute to anyone the message or any information contained in the
> message. If you have received this message in error, please immediately
> advise the sender by reply email and delete the message.  Thank you.

This message is intended for the sole use of the individual and entity to which 
it is addressed and may contain information that is privileged, confidential 
and exempt from disclosure under applicable law. If you are not the intended 
addressee, nor authorized to receive for the intended addressee, you are hereby 
notified that you may not use, copy, disclose or distribute to anyone the 
message or any information contained in the message. If you have received this 
message in error, please immediately advise the sender by reply email and 
delete the message.  Thank you.




reply via email to

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