Brett Kelly <inkedmn <at> inkedmn.com> writes:
> 
> I've read the SqlMode page on the wiki as well as the sql-help from within
> emacs, but I still can't figure out how to do this.
> 
> I'd like to be able to type in a sql query and have it return a resultset in a
> different buffer (a la Query Analyzer).  Here's what I'm doing now:
> - Create a new buffer, do M-x sql-ms RET, then enter the relevant connection
>   information (user, password, server, dbname). This gives me no errors.
> - Type in my SQL statement (I've tried simple "select" statements, as well as
>   more complicated "create proc" type stuff)
> - Highlight the relevant code with the mouse, and choose Send Region from the
>   SQL menu.
> 
> Now, if I'm understanding this correctly, I should see the results in a new
> buffer, but I'm not.

The `sql-ms' command should have opened up a new *SQL* buffer to hold the 
interaction with osql.  The results from a sql command you send to the command 
interpreter from a sql file should appear at the end of the *SQL* buffer.

I think you will find the Query Analyzer interaction model doesn't work well in 
the Emacs environment.  In the *SQL* buffer, you have all of Emacs' power to 
recall and edit sql statements.  You can then easily copy tested sql statements 
from your sql-ms buffer into a sql file script.  I also frequently copy the 
result rows, clean them up some in a scratch buffer and then paste them into 
other applications.

I have been playing around with a feature that will submit a single statement 
to the SQL command interpreter and displays the results in its own buffer.  But 
it is mostly useful for things like data dictionary listings.

If you give me more specific examples of what you want to be able to do and how 
you want to be able to interact with it, I may be able to offer more assistance.

-- Michael Mauger
sql.el maintainer




_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

Reply via email to