Using emacs on Ubuntu 11.10. I want to connect to a SQL Server database using sqsh instead of isql. I added the following to my initi.el
(set 'sql-sybase-program "sqsh")
(set 'sql-ms-program "sqsh")
It recompiles and loads successfully. However, when I use sql-ms and try to connect to the database, I am getting errors because emacs is using lower-case command parameters when it should be using upper-case command parameters. Furthermore, I can successfully connect to the database server using sqsh from the command line. When I try to run things within emacs, I get the following error:
sqsh: -d: Invalid integer expression
Process SQL exited abnormally with code 255
I did a pretty extensive Google search and I can't find much on how to do this (which makes me think it may not be possible). Obviously, I can run sqsh from within a shell, but then I lose the SQL mode integration. I'm not sure what I can / need to do to my init.el file to make this possible.
I think all I really need to do is figure out how to get emacs to send a -D not a -d to sqsh. Apparently isql doesn't care, but sqsh cares deeply about the difference.
As you say, the real answer is to get Emacs to use
-D
instead of-d
. However, as a workaround, runningsql-sybase
instead ofsql-ms
seems to work fine for me.Update: Try this code, it removes the
-n
option fromsql-ms-options
and redefinessql-ms-options
to use-D
instead of-d
as the option to select the database: