Created
June 7, 2012 15:51
-
-
Save ser1zw/2889597 to your computer and use it in GitHub Desktop.
カレントバッファの内容をSQL*Plusで実行するxyzzy lisp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ;; カレントバッファの内容をSQL*Plusで実行 | |
| (defun exec-sqlplus () | |
| (interactive) | |
| (let ((user "SCOTT") | |
| (passwd "TIGER") | |
| (host "localhost") | |
| (port 1521) | |
| (service-name "XE") | |
| (filename (make-temp-file-name)) | |
| command | |
| src) | |
| (setf command (format nil "sqlplus ~A/~A@~A:~A/~A @~A" user passwd host port service-name filename)) | |
| (setf src (format nil "~A~%~A~%~A~%" (buffer-substring (point-min) (point-max)) "SHOW ERRORS" "QUIT")) | |
| (with-open-file (out filename :direction :output) | |
| (princ src out)) | |
| (execute-shell-command command nil "SQL*Plus Output") | |
| (delete-file filename))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment