Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: problems with sql*plus buffer

Re: problems with sql*plus buffer

From: Pablo Sanchez <pablo_at_dev.null>
Date: 9 Oct 2002 11:06:53 -0500
Message-ID: <Xns92A267C328505pingottpingottbah@209.189.89.243>


TurkBear <john.greco_at_dot.state.mn.us> wrote in news:3mk8qu0aig9pno27u00m7t1ko94832ifph_at_4ax.com:

>
> SqlPlus is not a scripting too ( as you have discovered)l..Try
> SqlPlus Worksheet - It has editing and command history features..

For the emacs-savvy, the can download xemacs to their windows machines
and open a shell to start a sql*plus session. Once within the emacs session, you can do what you please: cut 'n paste, walk through history, etc.

For those seeking an example of what the init.el ought to look like ... word wrap might screw things up so beware ... :)

(defun sqlplus-shell-exec (my-buffer-name login-string)   (require 'shell)
  (start-process-shell-command "sqlplus" my-buffer-name "sqlplus" login-string)
  (switch-to-buffer-other-window my-buffer-name)   (shell-mode)
)

(defun sqlplus-shell (my-buffer-name login-string)

  (cond  ((eq nil (get-buffer my-buffer-name))                    ;; 
first time invocation
	  (sqlplus-shell-exec my-buffer-name login-string))

	 ((not (eq nil (get-buffer-process my-buffer-name)))      ;; 
process is running
	  (switch-to-buffer-other-window my-buffer-name))

	 (t                                                       ;; 
process doesn't exist, buffer does
	  (erase-buffer my-buffer-name)
	  (sqlplus-shell-exec my-buffer-name login-string))
	)

)

;; Bind a sql*plus session to F1
(global-set-key [f1] '(lambda () (interactive) (sqlplus-shell "*chickadee*" "scott/tiger_at_chickadee")))

-- 
Pablo Sanchez, High-Performance Database Engineering
http://www.hpdbe.com
Received on Wed Oct 09 2002 - 11:06:53 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US