Function: sql-comint-oracle

sql-comint-oracle is a byte-compiled function defined in sql.el.gz.

Signature

(sql-comint-oracle PRODUCT OPTIONS &optional BUF-NAME)

Documentation

Create comint buffer and connect to Oracle.

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/sql.el.gz
(defun sql-comint-oracle (product options &optional buf-name)
  "Create comint buffer and connect to Oracle."
  ;; Produce user/password@database construct.  Password without user
  ;; is meaningless; database without user/password is meaningless,
  ;; because "@param" will ask sqlplus to interpret the script
  ;; "param".
  (let (parameter nlslang coding)
    (if (not (string= "" sql-user))
	(if (not (string= "" sql-password))
	    (setq parameter (concat sql-user "/" sql-password))
	  (setq parameter sql-user)))
    (if (and parameter (not (string= "" sql-database)))
	(setq parameter (concat parameter "@" sql-database)))
    ;; options must appear before the logon parameters
    (if parameter
	(setq parameter (append options (list parameter)))
      (setq parameter options))
    (sql-comint product parameter buf-name)
    ;; Set process coding system to agree with the interpreter
    (setq nlslang (or (getenv "NLS_LANG") "")
          coding  (dolist (cs
                           ;; Are we missing any common NLS character sets
                           '(("US8PC437"  . cp437)
                             ("EL8PC737"  . cp737)
                             ("WE8PC850"  . cp850)
                             ("EE8PC852"  . cp852)
                             ("TR8PC857"  . cp857)
                             ("WE8PC858"  . cp858)
                             ("IS8PC861"  . cp861)
                             ("IW8PC1507" . cp862)
                             ("N8PC865"   . cp865)
                             ("RU8PC866"  . cp866)
                             ("US7ASCII"  . us-ascii)
                             ("UTF8"      . utf-8)
                             ("AL32UTF8"  . utf-8)
                             ("AL16UTF16" . utf-16))
                           (or coding 'utf-8))
                    (when (string-match (format "\\.%s\\'" (car cs)) nlslang)
                      (setq coding (cdr cs)))))
    (set-process-coding-system (get-buffer-process (current-buffer))
                               coding coding)))