unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Help with sql mode
@ 2010-04-08 14:07 Gary .
  2010-04-08 17:14 ` Richard Riley
  0 siblings, 1 reply; 7+ messages in thread
From: Gary . @ 2010-04-08 14:07 UTC (permalink / raw)
  To: help-gnu-emacs

Okay, so it seems to be running, and connected to my mysql server on localhost.

Err... now what? Obviously the simplest thing I want to do is execute
a query and see the results, but I'm <self censored> if I can find out
how to do that.




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Help with sql mode
  2010-04-08 14:07 Help with sql mode Gary .
@ 2010-04-08 17:14 ` Richard Riley
  2010-04-08 19:07   ` Gary .
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Riley @ 2010-04-08 17:14 UTC (permalink / raw)
  To: help-gnu-emacs

"Gary ." <help-gnu-emacs@garydjones.name> writes:

> Okay, so it seems to be running, and connected to my mysql server on localhost.
>
> Err... now what? Obviously the simplest thing I want to do is execute
> a query and see the results, but I'm <self censored> if I can find out
> how to do that.
>

You couldn't find that you simply type in a sql statement?

Example:

use mydatabase;
select name from phonerecords where name like "Ril%";

Its just an interface to mysql command line really. Not particularly
useful other than "its in emacs" ;)

Good luck!

regards

r.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Help with sql mode
  2010-04-08 17:14 ` Richard Riley
@ 2010-04-08 19:07   ` Gary .
  2010-04-08 19:27     ` Richard Riley
  0 siblings, 1 reply; 7+ messages in thread
From: Gary . @ 2010-04-08 19:07 UTC (permalink / raw)
  To: help-gnu-emacs

On Thu, Apr 8, 2010 at 7:14 PM, Richard Riley wrote:
> "Gary ." writes:
>
>> Okay, so it seems to be running, and connected to my mysql server on localhost.
>>
>> Err... now what? Obviously the simplest thing I want to do is execute
>> a query and see the results, but I'm <self censored> if I can find out
>> how to do that.
>>
>
> You couldn't find that you simply type in a sql statement?

Oh, I can type 'em in all right. Just not sure what to do then...

> Example:
>
> use mydatabase;
> select name from phonerecords where name like "Ril%";

Ah. Well I didn't do a use, I just tried
SELECT VERSION(), CURRENT_DATE;
and nothing happened.

> Its just an interface to mysql command line really. Not particularly
> useful other than "its in emacs" ;)

Which is about the most useful thing there is :)




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Help with sql mode
  2010-04-08 19:07   ` Gary .
@ 2010-04-08 19:27     ` Richard Riley
  2010-04-09  8:08       ` Gary .
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Riley @ 2010-04-08 19:27 UTC (permalink / raw)
  To: help-gnu-emacs

"Gary ." <help-gnu-emacs@garydjones.name> writes:

> On Thu, Apr 8, 2010 at 7:14 PM, Richard Riley wrote:
>> "Gary ." writes:
>>
>>> Okay, so it seems to be running, and connected to my mysql server on localhost.
>>>
>>> Err... now what? Obviously the simplest thing I want to do is execute
>>> a query and see the results, but I'm <self censored> if I can find out
>>> how to do that.
>>>
>>
>> You couldn't find that you simply type in a sql statement?
>
> Oh, I can type 'em in all right. Just not sure what to do then...
>
>> Example:
>>
>> use mydatabase;
>> select name from phonerecords where name like "Ril%";
>
> Ah. Well I didn't do a use, I just tried
> SELECT VERSION(), CURRENT_DATE;
> and nothing happened.
>

You don't need "use" for that. It should work.

>> Its just an interface to mysql command line really. Not particularly
>> useful other than "its in emacs" ;)
>
> Which is about the most useful thing there is :)
>

http://dev.mysql.com/doc/refman/5.1/en/creating-database.html






^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Help with sql mode
  2010-04-08 19:27     ` Richard Riley
@ 2010-04-09  8:08       ` Gary .
  2010-04-09 11:28         ` Richard Riley
  0 siblings, 1 reply; 7+ messages in thread
From: Gary . @ 2010-04-09  8:08 UTC (permalink / raw)
  To: help-gnu-emacs

On Thu, Apr 8, 2010 at 9:27 PM, Richard Riley wrote:
> "Gary ." writes:
>> On Thu, Apr 8, 2010 at 7:14 PM, Richard Riley wrote:
>>> Example:
>>>
>>> use mydatabase;
>>> select name from phonerecords where name like "Ril%";
>>
>> Ah. Well I didn't do a use, I just tried
>> SELECT VERSION(), CURRENT_DATE;
>> and nothing happened.
>>
>
> You don't need "use" for that. It should work.

Well, yeah. That's why I asked :)

Let me start from the beginning.
0. start emacs :)
1. `M-x sql-mysql' --> I am prompted for various connection infos
which I answer, window is split into two, one showing the current
buffer and one showing the *SQL* buffer
2. I type my query as shown previously into the *SQL* buffer --> I get
some nice syntax highlighting
3. Press RET / ENTER --> the highlighting vanishes... no sign of any
output anywhere...

My config looks like:
(require 'sql)
(setq auto-mode-alist
      (append '(("\\.sql$" . sql-mode)
                ("\\.tbl$" . sql-mode)
                ("\\.sp$"  . sql-mode))
              auto-mode-alist))

That's it.

The problem is I can't really find much documentation about this, it
seems to one of the least documented modes I've come across :(




^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Help with sql mode
  2010-04-09  8:08       ` Gary .
@ 2010-04-09 11:28         ` Richard Riley
  2010-04-09 12:07           ` Gary .
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Riley @ 2010-04-09 11:28 UTC (permalink / raw)
  To: help-gnu-emacs

"Gary ." <help-gnu-emacs@garydjones.name> writes:

> On Thu, Apr 8, 2010 at 9:27 PM, Richard Riley wrote:
>> "Gary ." writes:
>>> On Thu, Apr 8, 2010 at 7:14 PM, Richard Riley wrote:
>>>> Example:
>>>>
>>>> use mydatabase;
>>>> select name from phonerecords where name like "Ril%";
>>>
>>> Ah. Well I didn't do a use, I just tried
>>> SELECT VERSION(), CURRENT_DATE;
>>> and nothing happened.
>>>
>>
>> You don't need "use" for that. It should work.
>
> Well, yeah. That's why I asked :)
>
> Let me start from the beginning.
> 0. start emacs :)
> 1. `M-x sql-mysql' --> I am prompted for various connection infos
> which I answer, window is split into two, one showing the current
> buffer and one showing the *SQL* buffer
> 2. I type my query as shown previously into the *SQL* buffer --> I get
> some nice syntax highlighting
> 3. Press RET / ENTER --> the highlighting vanishes... no sign of any
> output anywhere...
>
> My config looks like:
> (require 'sql)
> (setq auto-mode-alist
>       (append '(("\\.sql$" . sql-mode)
>                 ("\\.tbl$" . sql-mode)
>                 ("\\.sp$"  . sql-mode))
>               auto-mode-alist))
>
> That's it.
>
> The problem is I can't really find much documentation about this, it
> seems to one of the least documented modes I've come across :(
>

I simply have

(define-key mode-specific-map [?Q] 'sql-mysql)

in emacs 23.

I dont edit sql, tbl or sp files directly and only use the interpreter.

Try with a more minimised .emacs and check nothing else is clashing.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Help with sql mode
  2010-04-09 11:28         ` Richard Riley
@ 2010-04-09 12:07           ` Gary .
  0 siblings, 0 replies; 7+ messages in thread
From: Gary . @ 2010-04-09 12:07 UTC (permalink / raw)
  To: help-gnu-emacs

On Fri, Apr 9, 2010 at 1:28 PM, Richard Riley wrote:
> "Gary ." writes:

>> Let me start from the beginning.
>> 0. start emacs :)
>> 1. `M-x sql-mysql' --> I am prompted for various connection infos
>> which I answer, window is split into two, one showing the current
>> buffer and one showing the *SQL* buffer
>> 2. I type my query as shown previously into the *SQL* buffer --> I get
>> some nice syntax highlighting
>> 3. Press RET / ENTER --> the highlighting vanishes... no sign of any
>> output anywhere...
>>
>> My config looks like:
>> (require 'sql)
>> (setq auto-mode-alist
>>       (append '(("\\.sql$" . sql-mode)
>>                 ("\\.tbl$" . sql-mode)
>>                 ("\\.sp$"  . sql-mode))
>>               auto-mode-alist))
>>
>> That's it.
>>
>> The problem is I can't really find much documentation about this, it
>> seems to one of the least documented modes I've come across :(
>>
>
> I simply have
>
> (define-key mode-specific-map [?Q] 'sql-mysql)
>
> in emacs 23.
>
> I dont edit sql, tbl or sp files directly and only use the interpreter.
>
> Try with a more minimised .emacs and check nothing else is clashing.

Well, even with /usr/bin/emacs --no-init-file it behaves the same,
although when I come to close emacs I get

Proc Status   Buffer Tty       Command
---- ------   ------ ---       -------
SQL  run      *SQL*  /dev/tty3 mysql

Active processes exist; kill them and exit anyway? (yes or no)

which I didn't get before. Odd.




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2010-04-09 12:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-08 14:07 Help with sql mode Gary .
2010-04-08 17:14 ` Richard Riley
2010-04-08 19:07   ` Gary .
2010-04-08 19:27     ` Richard Riley
2010-04-09  8:08       ` Gary .
2010-04-09 11:28         ` Richard Riley
2010-04-09 12:07           ` Gary .

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).