From 3770e7b13ca9fe756505f9cd90636ea18a5b5d63 Mon Sep 17 00:00:00 2001 From: "Kevin M. Rosenberg" Date: Sat, 29 May 2004 15:31:36 +0000 Subject: [PATCH] r9517: initial rename to db2 files --- db-db2/Makefile | 2 +- db-db2/README | 24 - db-db2/{oracle-api.lisp => db2-api.lisp} | 8 +- db-db2/db2-constants.lisp | 17 + .../{oracle-loader.lisp => db2-loader.lisp} | 46 +- .../{oracle-objects.lisp => db2-objects.lisp} | 38 +- .../{oracle-package.lisp => db2-package.lisp} | 16 +- db-db2/{oracle-sql.lisp => db2-sql.lisp} | 92 +-- db-db2/foreign-resources.lisp | 2 +- db-db2/oracle-constants.lisp | 543 ------------------ 10 files changed, 119 insertions(+), 669 deletions(-) delete mode 100644 db-db2/README rename db-db2/{oracle-api.lisp => db2-api.lisp} (98%) create mode 100644 db-db2/db2-constants.lisp rename db-db2/{oracle-loader.lisp => db2-loader.lisp} (54%) rename db-db2/{oracle-objects.lisp => db2-objects.lisp} (81%) rename db-db2/{oracle-package.lisp => db2-package.lisp} (66%) rename db-db2/{oracle-sql.lisp => db2-sql.lisp} (93%) delete mode 100644 db-db2/oracle-constants.lisp diff --git a/db-db2/Makefile b/db-db2/Makefile index ae4912b..8a26499 100644 --- a/db-db2/Makefile +++ b/db-db2/Makefile @@ -1,7 +1,7 @@ # FILE IDENTIFICATION # # Name: Makefile -# Purpose: Makefile for CLSQL Oracle interface +# Purpose: Makefile for CLSQL Db2 interface # Author: Kevin M. Rosenberg # Created: May 2004 # diff --git a/db-db2/README b/db-db2/README deleted file mode 100644 index 3bef886..0000000 --- a/db-db2/README +++ /dev/null @@ -1,24 +0,0 @@ -This is the header of the cadabra source file. - -;;;; a CMUCL/OCI implementation of a subset of the DBI interface -;;;; -;;;; The original version of this code was copyright (c) 1999-2000 Cadabra Inc. -;;;; It was placed in the public domain by Cadabra in January 2000. -;;;; -;;;; The implementors of the original version were Winton Davies -;;;; and William Newman . -;;;; The code will be maintained by Winton Davies. - -;;;; known issues: -;;;; * The code will leak C resources if errors occur in the the wrong -;;;; places, since it doesn't wrap its allocation/deallocation -;;;; logic in the necessary EVAL-WHENs to prevent this. (This could be -;;;; easily be an issue for long-running processes which recover from -;;;; database errors instead of simply terminating when they occur. It's -;;;; not an issue for programs which consider database errors so abnormal -;;;; that they die immediately when they encounter one.) -;;;; * Instead of reading Oracle header files automatically, this code -;;;; uses constants, types, and function signatures manually transcribed -;;;; from the Oracle header files. Thus, changes in the header files -;;;; may require manual maintenance of the code. (This version was written -;;;; for Oracle 8.1.5.) diff --git a/db-db2/oracle-api.lisp b/db-db2/db2-api.lisp similarity index 98% rename from db-db2/oracle-api.lisp rename to db-db2/db2-api.lisp index eab4c6b..61de25c 100644 --- a/db-db2/oracle-api.lisp +++ b/db-db2/db2-api.lisp @@ -2,8 +2,8 @@ ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; -;;;; Name: oracle.lisp -;;;; Purpose: Package definition for CLSQL Oracle interface +;;;; Name: db2.lisp +;;;; Purpose: Package definition for CLSQL Db2 interface ;;;; ;;;; $Id$ ;;;; @@ -14,7 +14,7 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(in-package #:clsql-oracle) +(in-package #:clsql-db2) ;; @@ -71,7 +71,7 @@ (#.+oci-continue+ (error 'sql-database-error :message "OCI Continue")) (1804 - (error 'sql-database-error :message "Check ORACLE_HOME and NLS settings.")) + (error 'sql-database-error :message "Check DB2_HOME and NLS settings.")) (t (error 'sql-database-error :message diff --git a/db-db2/db2-constants.lisp b/db-db2/db2-constants.lisp new file mode 100644 index 0000000..0b3f48e --- /dev/null +++ b/db-db2/db2-constants.lisp @@ -0,0 +1,17 @@ +;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- +;;;; ************************************************************************* +;;;; FILE IDENTIFICATION +;;;; +;;;; Name: db2-constants.lisp +;;;; Purpose: Constants for CLSQL Db2 interface +;;;; +;;;; $Id$ +;;;; +;;;; This file is part of CLSQL. +;;;; +;;;; CLSQL users are granted the rights to distribute and use this software +;;;; as governed by the terms of the Lisp Lesser GNU Public License +;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. +;;;; ************************************************************************* + +(in-package #:clsql-db2) diff --git a/db-db2/oracle-loader.lisp b/db-db2/db2-loader.lisp similarity index 54% rename from db-db2/oracle-loader.lisp rename to db-db2/db2-loader.lisp index 6d91e8d..0e53a31 100644 --- a/db-db2/oracle-loader.lisp +++ b/db-db2/db2-loader.lisp @@ -2,8 +2,8 @@ ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; -;;;; Name: oracle-loader.lisp -;;;; Purpose: Foreign library loader for CLSQL Oracle interface +;;;; Name: db2-loader.lisp +;;;; Purpose: Foreign library loader for CLSQL Db2 interface ;;;; ;;;; $Id$ ;;;; @@ -14,46 +14,46 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(in-package #:clsql-oracle) +(in-package #:clsql-db2) -(defparameter *oracle-lib-path* - (let ((oracle-home (getenv "ORACLE_HOME"))) - (when oracle-home +(defparameter *db2-lib-path* + (let ((db2-home (getenv "DB2_HOME"))) + (when db2-home (make-pathname :directory (append (pathname-directory - (parse-namestring (concatenate 'string oracle-home "/"))) + (parse-namestring (concatenate 'string db2-home "/"))) (list "lib")))))) -(defparameter *oracle-client-library-path* +(defparameter *db2-client-library-path* (uffi:find-foreign-library "libclntsh" `(,@(when *load-truename* (list (make-pathname :directory (pathname-directory *load-truename*)))) - ,@(when *oracle-lib-path* (list *oracle-lib-path*)) - "/usr/lib/oracle/10.1.0.2/client/lib/") + ,@(when *db2-lib-path* (list *db2-lib-path*)) + "/usr/lib/db2/10.1.0.2/client/lib/") :drive-letters '("C"))) -(defvar *oracle-supporting-libraries* '("c") +(defvar *db2-supporting-libraries* '("c") "Used only by CMU. List of library flags needed to be passed to ld to -load the Oracle client library succesfully. If this differs at your site, +load the Db2 client library succesfully. If this differs at your site, set to the right path before compiling or loading the system.") -(defvar *oracle-library-loaded* nil +(defvar *db2-library-loaded* nil "T if foreign library was able to be loaded successfully") -(defmethod clsql-sys:database-type-library-loaded ((database-type (eql :oracle))) - *oracle-library-loaded*) +(defmethod clsql-sys:database-type-library-loaded ((database-type (eql :db2))) + *db2-library-loaded*) -(defmethod clsql-sys:database-type-load-foreign ((database-type (eql :oracle))) - (if (pathnamep *oracle-client-library-path*) +(defmethod clsql-sys:database-type-load-foreign ((database-type (eql :db2))) + (if (pathnamep *db2-client-library-path*) (progn - (uffi:load-foreign-library *oracle-client-library-path* - :module "clsql-oracle" + (uffi:load-foreign-library *db2-client-library-path* + :module "clsql-db2" :supporting-libraries - *oracle-supporting-libraries*) - (setq *oracle-library-loaded* t)) - (warn "Unable to load oracle client library."))) + *db2-supporting-libraries*) + (setq *db2-library-loaded* t)) + (warn "Unable to load db2 client library."))) -(clsql-sys:database-type-load-foreign :oracle) +(clsql-sys:database-type-load-foreign :db2) diff --git a/db-db2/oracle-objects.lisp b/db-db2/db2-objects.lisp similarity index 81% rename from db-db2/oracle-objects.lisp rename to db-db2/db2-objects.lisp index a5583ee..288e573 100644 --- a/db-db2/oracle-objects.lisp +++ b/db-db2/db2-objects.lisp @@ -2,7 +2,7 @@ ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; -;;;; Name: oracle-objects.lisp +;;;; Name: db2-objects.lisp ;;;; ;;;; $Id$ ;;;; @@ -13,14 +13,14 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(in-package #:clsql-oracle) +(in-package #:clsql-db2) -(defmethod database-get-type-specifier (type args database (db-type (eql :oracle))) +(defmethod database-get-type-specifier (type args database (db-type (eql :db2))) (declare (ignore type args database)) (format nil "VARCHAR2(~D)" *default-varchar-length*)) (defmethod database-get-type-specifier ((type (eql 'integer)) args - database (db-type (eql :oracle))) + database (db-type (eql :db2))) (declare (ignore database)) (if args (format nil "NUMBER(~A,~A)" @@ -28,38 +28,38 @@ "INTEGER")) (defmethod database-get-type-specifier ((type (eql 'bigint)) args - database (db-type (eql :oracle))) + database (db-type (eql :db2))) (declare (ignore args database)) "CHAR(20)") (defmethod database-get-type-specifier ((type (eql 'universal-time)) args - database (db-type (eql :oracle))) + database (db-type (eql :db2))) (declare (ignore args database)) "CHAR(20)") (defmethod database-get-type-specifier ((type (eql 'string)) args - database (db-type (eql :oracle))) + database (db-type (eql :db2))) (declare (ignore database)) (if args (format nil "CHAR(~A)" (car args)) (format nil "VARCHAR2(~D)" *default-varchar-length*))) (defmethod database-get-type-specifier ((type (eql 'varchar)) args - database (db-type (eql :oracle))) + database (db-type (eql :db2))) (declare (ignore database)) (if args (format nil "VARCHAR2(~A)" (car args)) (format nil "VARCHAR2(~D)" *default-varchar-length*))) (defmethod database-get-type-specifier ((type (eql 'float)) args - database (db-type (eql :oracle))) + database (db-type (eql :db2))) (declare (ignore database)) (if args (format nil "NUMBER(~A,~A)" (or (first args) 38) (or (second args) 38)) "DOUBLE PRECISION")) (defmethod database-get-type-specifier ((type (eql 'long-float)) args - database (db-type (eql :oracle))) + database (db-type (eql :db2))) (declare (ignore database)) (if args (format nil "NUMBER(~A,~A)" @@ -67,12 +67,12 @@ "DOUBLE PRECISION")) (defmethod database-get-type-specifier ((type (eql 'boolean)) args - database (db-type (eql :oracle))) + database (db-type (eql :db2))) (declare (ignore args database)) "CHAR(1)") (defmethod read-sql-value (val type - database (db-type (eql :oracle))) + database (db-type (eql :db2))) ;;(format t "value is \"~A\" of type ~A~%" val (type-of val)) (declare (ignore type database)) (etypecase val @@ -82,38 +82,38 @@ nil))) (defmethod read-sql-value (val (type (eql 'integer)) - database (db-type (eql :oracle))) + database (db-type (eql :db2))) (declare (ignore database)) val) (defmethod read-sql-value (val (type (eql 'float)) - database (db-type (eql :oracle))) + database (db-type (eql :db2))) (declare (ignore database)) val) (defmethod read-sql-value (val (type (eql 'boolean)) - database (db-type (eql :oracle))) + database (db-type (eql :db2))) (declare (ignore database)) (when (char-equal #\t (schar val 0)) t)) (defmethod read-sql-value (val (type (eql 'bigint)) - database (db-type (eql :oracle))) + database (db-type (eql :db2))) (declare (ignore database)) (parse-integer val)) (defmethod read-sql-value (val (type (eql 'universal-time)) - database (db-type (eql :oracle))) + database (db-type (eql :db2))) (declare (ignore database)) (parse-integer val)) (defmethod database-get-type-specifier ((type (eql 'wall-time)) args - database (db-type (eql :oracle))) + database (db-type (eql :db2))) (declare (ignore args database)) "DATE") (defmethod database-get-type-specifier ((type (eql 'duration)) args - database (db-type (eql :oracle))) + database (db-type (eql :db2))) (declare (ignore args database)) "NUMBER(38)") diff --git a/db-db2/oracle-package.lisp b/db-db2/db2-package.lisp similarity index 66% rename from db-db2/oracle-package.lisp rename to db-db2/db2-package.lisp index 07f0a55..9ca0984 100644 --- a/db-db2/oracle-package.lisp +++ b/db-db2/db2-package.lisp @@ -2,8 +2,8 @@ ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; -;;;; Name: oracle-package.cl -;;;; Purpose: Package definition for CLSQL Oracle interface +;;;; Name: db2-package.cl +;;;; Purpose: Package definition for CLSQL Db2 interface ;;;; ;;;; $Id$ ;;;; @@ -16,10 +16,10 @@ (in-package #:cl-user) -(defpackage #:clsql-oracle +(defpackage #:clsql-db2 (:use #:common-lisp #:clsql-sys #:clsql-uffi) - (:export #:oracle-database - #:*oracle-server-version* - #:*oracle-so-load-path* - #:*oracle-so-libraries*) - (:documentation "This is the CLSQL interface to Oracle.")) + (:export #:db2-database + #:*db2-server-version* + #:*db2-so-load-path* + #:*db2-so-libraries*) + (:documentation "This is the CLSQL interface to Db2.")) diff --git a/db-db2/oracle-sql.lisp b/db-db2/db2-sql.lisp similarity index 93% rename from db-db2/oracle-sql.lisp rename to db-db2/db2-sql.lisp index 0250a34..62333e3 100644 --- a/db-db2/oracle-sql.lisp +++ b/db-db2/db2-sql.lisp @@ -2,7 +2,7 @@ ;;;; ************************************************************************* ;;;; FILE IDENTIFICATION ;;;; -;;;; Name: oracle-sql.lisp +;;;; Name: db2-sql.lisp ;;;; ;;;; $Id$ ;;;; @@ -13,9 +13,9 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(in-package #:clsql-oracle) +(in-package #:clsql-db2) -(defmethod database-initialize-database-type ((database-type (eql :oracle))) +(defmethod database-initialize-database-type ((database-type (eql :db2))) t) ;;;; arbitrary parameters, tunable for performance or other reasons @@ -66,7 +66,7 @@ likely that we'll have to worry about the CMUCL limit.")) (uffi:def-type pointer-pointer-void '(* :pointer-void)) -(defclass oracle-database (database) ; was struct db +(defclass db2-database (database) ; was struct db ((envhp :reader envhp :initarg :envhp @@ -112,13 +112,13 @@ the length of that format.") :initarg :server-version :reader server-version :documentation - "Version string of Oracle server.") + "Version string of Db2 server.") (major-server-version :type (or null fixnum) :initarg :major-server-version :reader major-server-version :documentation - "The major version number of the Oracle server, should be 8, 9, or 10"))) + "The major version number of the Db2 server, should be 8, 9, or 10"))) ;;; Handle the messy case of return code=+oci-error+, querying the @@ -185,7 +185,7 @@ the length of that format.") ;; Return the INDEXth string of the OCI array, represented as Lisp ;; SIMPLE-STRING. SIZE is the size of the fixed-width fields used by -;; Oracle to store strings within the array. +;; Db2 to store strings within the array. (uffi:def-type string-pointer (* :unsigned-char)) @@ -200,7 +200,7 @@ the length of that format.") (if (string-equal str "NULL") nil str))) ;; the OCI library, part Z: no-longer used logic to convert from -;; Oracle's binary date representation to Common Lisp's native date +;; Db2's binary date representation to Common Lisp's native date ;; representation #+nil @@ -232,7 +232,7 @@ the length of that format.") (encode-universal-time second minute hour day month year)))) -(defmethod database-list-tables ((database oracle-database) &key owner) +(defmethod database-list-tables ((database db2-database) &key owner) (let ((query (if owner (format nil @@ -242,7 +242,7 @@ the length of that format.") (mapcar #'car (database-query query database nil nil)))) -(defmethod database-list-views ((database oracle-database) &key owner) +(defmethod database-list-views ((database db2-database) &key owner) (let ((query (if owner (format nil @@ -252,7 +252,7 @@ the length of that format.") (mapcar #'car (database-query query database nil nil)))) -(defmethod database-list-indexes ((database oracle-database) +(defmethod database-list-indexes ((database db2-database) &key (owner nil)) (let ((query (if owner @@ -262,7 +262,7 @@ the length of that format.") "select index_name from user_indexes"))) (mapcar #'car (database-query query database nil nil)))) -(defmethod database-list-table-indexes (table (database oracle-database) +(defmethod database-list-table-indexes (table (database db2-database) &key (owner nil)) (let ((query (if owner @@ -274,7 +274,7 @@ the length of that format.") (mapcar #'car (database-query query database nil nil)))) -(defmethod database-list-attributes (table (database oracle-database) &key owner) +(defmethod database-list-attributes (table (database db2-database) &key owner) (let ((query (if owner (format nil @@ -286,7 +286,7 @@ the length of that format.") (mapcar #'car (database-query query database nil nil)))) (defmethod database-attribute-type (attribute (table string) - (database oracle-database) + (database db2-database) &key (owner nil)) (let ((query (if owner @@ -323,11 +323,11 @@ the length of that format.") (uffi:def-type double-pointer '(* :double)) ;;; the result of a database query: a cursor through a table -(defstruct (oracle-result-set (:print-function print-query-cursor) +(defstruct (db2-result-set (:print-function print-query-cursor) (:conc-name qc-) (:constructor %make-query-cursor)) (db (error "missing DB") ; db conn. this table is associated with - :type oracle-database + :type db2-database :read-only t) (stmthp (error "missing STMTHP") ; the statement handle used to create ;; :type alien ; this table. owned by the QUERY-CURSOR @@ -562,7 +562,7 @@ the length of that format.") (defun make-query-cursor-cds (database stmthp result-types field-names) (declare (optimize (safety 3) #+nil (speed 3)) - (type oracle-database database) + (type db2-database database) (type pointer-pointer-void stmthp)) (with-slots (errhp) database (uffi:with-foreign-objects ((dtype-foreign :unsigned-short) @@ -699,14 +699,14 @@ the length of that format.") (values)) -(defmethod database-name-from-spec (connection-spec (database-type (eql :oracle))) +(defmethod database-name-from-spec (connection-spec (database-type (eql :db2))) (check-connection-spec connection-spec database-type (dsn user password)) (destructuring-bind (dsn user password) connection-spec (declare (ignore password)) (concatenate 'string dsn "/" user))) -(defmethod database-connect (connection-spec (database-type (eql :oracle))) +(defmethod database-connect (connection-spec (database-type (eql :db2))) (check-connection-spec connection-spec database-type (dsn user password)) (destructuring-bind (data-source-name user password) connection-spec @@ -753,13 +753,13 @@ the length of that format.") ;; oci-handle-alloc((dvoid *)encvhp, (dvoid **)&stmthp, OCI_HTYPE_STMT, 0, 0); ;;#+nil - (let ((db (make-instance 'oracle-database + (let ((db (make-instance 'db2-database :name (database-name-from-spec connection-spec database-type) :connection-spec connection-spec :envhp envhp :errhp errhp - :database-type :oracle + :database-type :db2 :svchp svchp :dsn data-source-name :user user))) @@ -776,7 +776,7 @@ the length of that format.") (format nil "ALTER SESSION SET NLS_DATE_FORMAT='~A'" (date-format db)) db) (let ((server-version (caar (database-query - "SELECT BANNER FROM V$VERSION WHERE BANNER LIKE '%Oracle%'" db nil nil)))) + "SELECT BANNER FROM V$VERSION WHERE BANNER LIKE '%Db2%'" db nil nil)))) (setf (slot-value db 'server-version) server-version (slot-value db 'major-server-version) (major-client-version-from-string server-version))) @@ -787,9 +787,9 @@ the length of that format.") (cond ((search " 10g " str) 10) - ((search "Oracle9i " str) + ((search "Db29i " str) 9) - ((search "Oracle8" str) + ((search "Db28" str) 8))) (defun major-server-version-from-string (str) @@ -805,7 +805,7 @@ the length of that format.") ;; Close a database connection. -(defmethod database-disconnect ((database oracle-database)) +(defmethod database-disconnect ((database db2-database)) (osucc (oci-logoff (deref-vp (svchp database)) (deref-vp (errhp database)))) (osucc (oci-handle-free (deref-vp (envhp database)) +oci-htype-env+)) @@ -826,7 +826,7 @@ the length of that format.") ;;; to construct the table. The Allegro version supports several possible ;;; values for this argument, but we only support :AUTO. -(defmethod database-query (query-expression (database oracle-database) result-types field-names) +(defmethod database-query (query-expression (database db2-database) result-types field-names) (let ((cursor (sql-stmt-exec query-expression database result-types field-names))) ;; (declare (type (or query-cursor null) cursor)) (if (null cursor) ; No table was returned. @@ -845,17 +845,17 @@ the length of that format.") (push row reversed-result)))))) -(defmethod database-create-sequence (sequence-name (database oracle-database)) +(defmethod database-create-sequence (sequence-name (database db2-database)) (execute-command (concatenate 'string "CREATE SEQUENCE " (sql-escape sequence-name)) :database database)) -(defmethod database-drop-sequence (sequence-name (database oracle-database)) +(defmethod database-drop-sequence (sequence-name (database db2-database)) (execute-command (concatenate 'string "DROP SEQUENCE " (sql-escape sequence-name)) :database database)) -(defmethod database-sequence-next (sequence-name (database oracle-database)) +(defmethod database-sequence-next (sequence-name (database db2-database)) (caar (database-query (concatenate 'string "SELECT " @@ -864,7 +864,7 @@ the length of that format.") ) database :auto nil))) -(defmethod database-set-sequence-position (name position (database oracle-database)) +(defmethod database-set-sequence-position (name position (database db2-database)) (without-interrupts (let* ((next (database-sequence-next name database)) (incr (- position next))) @@ -876,7 +876,7 @@ the length of that format.") (format nil "ALTER SEQUENCE ~A INCREMENT BY 1" name) database)))) -(defmethod database-list-sequences ((database oracle-database) &key owner) +(defmethod database-list-sequences ((database db2-database) &key owner) (let ((query (if owner (format nil @@ -885,10 +885,10 @@ the length of that format.") "select sequence_name from user_sequences"))) (mapcar #'car (database-query query database nil nil)))) -(defmethod database-execute-command (sql-expression (database oracle-database)) +(defmethod database-execute-command (sql-expression (database db2-database)) (database-query sql-expression database nil nil) (when (database-autocommit database) - (oracle-commit database)) + (db2-commit database)) t) @@ -937,7 +937,7 @@ the length of that format.") (defmethod database-query-result-set ((query-expression string) - (database oracle-database) + (database db2-database) &key full-set result-types) (let ((cursor (sql-stmt-exec query-expression database result-types nil))) (if full-set @@ -945,10 +945,10 @@ the length of that format.") (values cursor (length (qc-cds cursor)))))) -(defmethod database-dump-result-set (result-set (database oracle-database)) +(defmethod database-dump-result-set (result-set (database db2-database)) (close-query result-set)) -(defmethod database-store-next-row (result-set (database oracle-database) list) +(defmethod database-store-next-row (result-set (database db2-database) list) (let* ((eof-value :eof) (row (fetch-row result-set nil eof-value))) (unless (eq eof-value row) @@ -956,7 +956,7 @@ the length of that format.") do (setf (nth i list) (nth i row))) list))) -(defmethod database-start-transaction ((database oracle-database)) +(defmethod database-start-transaction ((database db2-database)) (call-next-method) ;; Not needed with simple transaction #+ignore @@ -968,18 +968,18 @@ the length of that format.") t) -(defun oracle-commit (database) +(defun db2-commit (database) (with-slots (svchp errhp) database (osucc (oci-trans-commit (deref-vp svchp) (deref-vp errhp) 0)))) -(defmethod database-commit-transaction ((database oracle-database)) +(defmethod database-commit-transaction ((database db2-database)) (call-next-method) - (oracle-commit database) + (db2-commit database) t) -(defmethod database-abort-transaction ((database oracle-database)) +(defmethod database-abort-transaction ((database db2-database)) (call-next-method) (osucc (oci-trans-rollback (deref-vp (svchp database)) (deref-vp (errhp database)) @@ -988,14 +988,14 @@ the length of that format.") ;; Specifications -(defmethod db-type-has-bigint? ((type (eql :oracle))) +(defmethod db-type-has-bigint? ((type (eql :db2))) nil) -(defmethod db-type-has-fancy-math? ((db-type (eql :oracle))) +(defmethod db-type-has-fancy-math? ((db-type (eql :db2))) t) -(defmethod db-type-has-boolean-where? ((db-type (eql :oracle))) +(defmethod db-type-has-boolean-where? ((db-type (eql :db2))) nil) -(when (clsql-sys:database-type-library-loaded :oracle) - (clsql-sys:initialize-database-type :database-type :oracle)) +(when (clsql-sys:database-type-library-loaded :db2) + (clsql-sys:initialize-database-type :database-type :db2)) diff --git a/db-db2/foreign-resources.lisp b/db-db2/foreign-resources.lisp index badfedc..1a8d866 100644 --- a/db-db2/foreign-resources.lisp +++ b/db-db2/foreign-resources.lisp @@ -11,7 +11,7 @@ ;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. ;;;; ************************************************************************* -(in-package #:clsql-oracle) +(in-package #:clsql-db2) (defparameter *foreign-resource-hash* (make-hash-table :test #'equal)) diff --git a/db-db2/oracle-constants.lisp b/db-db2/oracle-constants.lisp deleted file mode 100644 index 692b55b..0000000 --- a/db-db2/oracle-constants.lisp +++ /dev/null @@ -1,543 +0,0 @@ -;;;; -*- Mode: LISP; Syntax: ANSI-Common-Lisp; Base: 10 -*- -;;;; ************************************************************************* -;;;; FILE IDENTIFICATION -;;;; -;;;; Name: oracle-constants.lisp -;;;; Purpose: Constants for CLSQL Oracle interface -;;;; -;;;; $Id$ -;;;; -;;;; This file is part of CLSQL. -;;;; -;;;; CLSQL users are granted the rights to distribute and use this software -;;;; as governed by the terms of the Lisp Lesser GNU Public License -;;;; (http://opensource.franz.com/preamble.html), also known as the LLGPL. -;;;; ************************************************************************* - -(in-package #:clsql-oracle) - -(defconstant +oci-default+ #x00) ; default value for parameters and attributes -(defconstant +oci-threaded+ #x01) ; application is in threaded environment -(defconstant +oci-object+ #x02) ; the application is in object environment -(defconstant +oci-non-blocking+ #x04) ; non blocking mode of operation -(defconstant +oci-env-no-mutex+ #x08) ; the environment handle will not be protected by a mutex internally - -;; Handle types - -(defconstant +oci-htype-env+ 1) ; environment handle -(defconstant +oci-htype-error+ 2) ; error handle -(defconstant +oci-htype-svcctx+ 3) ; service handle -(defconstant +oci-htype-stmt+ 4) ; statement handle -(defconstant +oci-htype-bind+ 5) ; bind handle -(defconstant +oci-htype-define+ 6) ; define handle -(defconstant +oci-htype-describe+ 7) ; describe handle -(defconstant +oci-htype-server+ 8) ; server handle -(defconstant +oci-htype-session+ 9) ; authentication handle -(defconstant +oci-htype-trans+ 10) ; transaction handle -(defconstant +oci-htype-complexobject+ 11) ; complex object retrieval handle -(defconstant +oci-htype-security+ 12) ; security handle - -;; Descriptor types - -(defconstant +oci-dtype-lob+ 50) ; lob locator -(defconstant +oci-dtype-snap+ 51) ; snapshot -(defconstant +oci-dtype-rset+ 52) ; result set -(defconstant +oci-dtype-param+ 53) ; parameter descriptor obtained from ocigparm -(defconstant +oci-dtype-rowid+ 54) ; rowid -(defconstant +oci-dtype-complexobjectcomp+ 55) ; complex object retrieval descriptor -(defconstant +oci-dtype-file+ 56) ; File Lob locator -(defconstant +oci-dtype-aqenq-options+ 57) ; enqueue options -(defconstant +oci-dtype-aqdeq-options+ 58) ; dequeue options -(defconstant +oci-dtype-aqmsg-properties+ 59) ; message properties -(defconstant +oci-dtype-aqagent+ 60) ; aq agent - -;; Objectr pointer types - -(defconstant +oci-otype-name+ 1) ; object name -(defconstant +oci-otype-ref+ 2) ; REF to TDO -(defconstant +oci-otype-ptr+ 3) ; PTR to TDO - -;; Attribute types - -(defconstant +oci-attr-fncode+ 1) ; the OCI function code -(defconstant +oci-attr-object+ 2) ; is the environment initialized in object mode -(defconstant +oci-attr-nonblocking-mode+ 3) ; non blocking mode -(defconstant +oci-attr-sqlcode+ 4) ; the SQL verb -(defconstant +oci-attr-env+ 5) ; the environment handle -(defconstant +oci-attr-server+ 6) ; the server handle -(defconstant +oci-attr-session+ 7) ; the user session handle -(defconstant +oci-attr-trans+ 8) ; the transaction handle -(defconstant +oci-attr-row-count+ 9) ; the rows processed so far -(defconstant +oci-attr-sqlfncode+ 10) ; the SQL verb of the statement -(defconstant +oci-attr-prefetch-rows+ 11) ; sets the number of rows to prefetch -(defconstant +oci-attr-nested-prefetch-rows+ 12) ; the prefetch rows of nested table -(defconstant +oci-attr-prefetch-memory+ 13) ; memory limit for rows fetched -(defconstant +oci-attr-nested-prefetch-memory+ 14) ; memory limit for nested rows -(defconstant +oci-attr-char-count+ 15) ; this specifies the bind and define size in characters -(defconstant +oci-attr-pdscl+ 16) ; packed decimal scale -(defconstant +oci-attr-pdfmt+ 17) ; packed decimal format -(defconstant +oci-attr-param-count+ 18) ; number of column in the select list -(defconstant +oci-attr-rowid+ 19) ; the rowid -(defconstant +oci-attr-charset+ 20) ; the character set value -(defconstant +oci-attr-nchar+ 21) ; NCHAR type -(defconstant +oci-attr-username+ 22) ; username attribute -(defconstant +oci-attr-password+ 23) ; password attribute -(defconstant +oci-attr-stmt-type+ 24) ; statement type -(defconstant +oci-attr-internal-name+ 25) ; user friendly global name -(defconstant +oci-attr-external-name+ 26) ; the internal name for global txn -(defconstant +oci-attr-xid+ 27) ; XOPEN defined global transaction id -(defconstant +oci-attr-trans-lock+ 28) ; -(defconstant +oci-attr-trans-name+ 29) ; string to identify a global transaction -(defconstant +oci-attr-heapalloc+ 30) ; memory allocated on the heap -(defconstant +oci-attr-charset-id+ 31) ; Character Set ID -(defconstant +oci-attr-charset-form+ 32) ; Character Set Form -(defconstant +oci-attr-maxdata-size+ 33) ; Maximumsize of data on the server -(defconstant +oci-attr-cache-opt-size+ 34) ; object cache optimal size -(defconstant +oci-attr-cache-max-size+ 35) ; object cache maximum size percentage -(defconstant +oci-attr-pinoption+ 36) ; object cache default pin option -(defconstant +oci-attr-alloc-duration+ 37) ; object cache default allocation duration -(defconstant +oci-attr-pin-duration+ 38) ; object cache default pin duration -(defconstant +oci-attr-fdo+ 39) ; Format Descriptor object attribute -(defconstant +oci-attr-postprocessing-callback+ 40) ; Callback to process outbind data -(defconstant +oci-attr-postprocessing-context+ 41) ; Callback context to process outbind data -(defconstant +oci-attr-rows-returned+ 42) ; Number of rows returned in current iter - for Bind handles -(defconstant +oci-attr-focbk+ 43) ; Failover Callback attribute -(defconstant +oci-attr-in-v8-mode+ 44) ; is the server/service context in V8 mode -(defconstant +oci-attr-lobempty+ 45) ; empty lob ? -(defconstant +oci-attr-sesslang+ 46) ; session language handle - -;; AQ Attribute Types -;; Enqueue Options - -(defconstant +oci-attr-visibility+ 47) ; visibility -(defconstant +oci-attr-relative-msgid+ 48) ; relative message id -(defconstant +oci-attr-sequence-deviation+ 49) ; sequence deviation - -; - Dequeue Options - - ; consumer name -;#define OCI-ATTR-DEQ-MODE 50 -;(defconstant +OCI-ATTR-CONSUMER-NAME 50 + 51) ; dequeue mode -;#define OCI-ATTR-NAVIGATION 52 ; navigation -;#define OCI-ATTR-WAIT 53 ; wait -;#define OCI-ATTR-DEQ-MSGID 54 ; dequeue message id - -; - Message Properties - -(defconstant +OCI-ATTR-PRIORITY+ 55) ; priority -(defconstant +OCI-ATTR-DELAY+ 56) ; delay -(defconstant +OCI-ATTR-EXPIRATION+ 57) ; expiration -(defconstant +OCI-ATTR-CORRELATION+ 58) ; correlation id -(defconstant +OCI-ATTR-ATTEMPTS+ 59) ; # of attempts -(defconstant +OCI-ATTR-RECIPIENT-LIST+ 60) ; recipient list -(defconstant +OCI-ATTR-EXCEPTION-QUEUE+ 61) ; exception queue name -(defconstant +OCI-ATTR-ENQ-TIME+ 62) ; enqueue time (only OCIAttrGet) -(defconstant +OCI-ATTR-MSG-STATE+ 63) ; message state (only OCIAttrGet) - -;; AQ Agent -(defconstant +OCI-ATTR-AGENT-NAME+ 64) ; agent name -(defconstant +OCI-ATTR-AGENT-ADDRESS+ 65) ; agent address -(defconstant +OCI-ATTR-AGENT-PROTOCOL+ 66) ; agent protocol - -;- Server handle - -(defconstant +OCI-ATTR-NATIVE-FDES+ 67) ; native cncxn file desc - -;-Parameter Attribute Types- - -(defconstant +OCI-ATTR-UNK+ 101) ; unknown attribute -(defconstant +OCI-ATTR-NUM-COLS+ 102) ; number of columns -(defconstant +OCI-ATTR-LIST-COLUMNS+ 103) ; parameter of the column list -(defconstant +OCI-ATTR-RDBA+ 104) ; DBA of the segment header -(defconstant +OCI-ATTR-CLUSTERED+ 105) ; whether the table is clustered -(defconstant +OCI-ATTR-PARTITIONED+ 106) ; whether the table is partitioned -(defconstant +OCI-ATTR-INDEX-ONLY+ 107) ; whether the table is index only -(defconstant +OCI-ATTR-LIST-ARGUMENTS+ 108) ; parameter of the argument list -(defconstant +OCI-ATTR-LIST-SUBPROGRAMS+ 109) ; parameter of the subprogram list -(defconstant +OCI-ATTR-REF-TDO+ 110) ; REF to the type descriptor -(defconstant +OCI-ATTR-LINK+ 111) ; the database link name -(defconstant +OCI-ATTR-MIN+ 112) ; minimum value -(defconstant +OCI-ATTR-MAX+ 113) ; maximum value -(defconstant +OCI-ATTR-INCR+ 114) ; increment value -(defconstant +OCI-ATTR-CACHE+ 115) ; number of sequence numbers cached -(defconstant +OCI-ATTR-ORDER+ 116) ; whether the sequence is ordered -(defconstant +OCI-ATTR-HW-MARK+ 117) ; high-water mark -(defconstant +OCI-ATTR-TYPE-SCHEMA+ 118) ; type's schema name -(defconstant +OCI-ATTR-TIMESTAMP+ 119) ; timestamp of the object -(defconstant +OCI-ATTR-NUM-ATTRS+ 120) ; number of sttributes -(defconstant +OCI-ATTR-NUM-PARAMS+ 121) ; number of parameters -(defconstant +OCI-ATTR-OBJID+ 122) ; object id for a table or view -(defconstant +OCI-ATTR-PTYPE+ 123) ; type of info described by -(defconstant +OCI-ATTR-PARAM+ 124) ; parameter descriptor -(defconstant +OCI-ATTR-OVERLOAD-ID+ 125) ; overload ID for funcs and procs -(defconstant +OCI-ATTR-TABLESPACE+ 126) ; table name space -(defconstant +OCI-ATTR-TDO+ 127) ; TDO of a type -(defconstant +OCI-ATTR-PARSE-ERROR-OFFSET+ 128) ; Parse Error offset -;-Credential Types- -(defconstant +OCI-CRED-RDBMS+ 1) ; database username/password -(defconstant +OCI-CRED-EXT+ 2) ; externally provided credentials - -;; Error Return Values- - -(defconstant +oci-continue+ -24200) ; Continue with the body of the OCI function -(defconstant +oci-still-executing+ -3123) ; OCI would block error -(defconstant +oci-invalid-handle+ -2) ; maps to SQL-INVALID-HANDLE -(defconstant +oci-error+ -1) ; maps to SQL-ERROR -(defconstant +oci-success+ 0) ; maps to SQL-SUCCESS of SAG CLI -(defconstant +oci-success-with-info+ 1) ; maps to SQL-SUCCESS-WITH-INFO -(defconstant +oci-need-data+ 99) ; maps to SQL-NEED-DATA -(defconstant +oci-no-data+ 100) ; maps to SQL-NO-DATA - -;; Parsing Syntax Types- - -(defconstant +oci-ntv-syntax+ 1) ; Use what so ever is the native lang of server -(defconstant +oci-v7-syntax+ 2) ; V7 language -(defconstant +oci-v8-syntax+ 3) ; V8 language - -;-Scrollable Cursor Options- - -(defconstant +oci-fetch-next+ #x02) ; next row -(defconstant +oci-fetch-first+ #x04) ; first row of the result set -(defconstant +oci-fetch-last+ #x08) ; the last row of the result set -(defconstant +oci-fetch-prior+ #x10) ; the previous row relative to current -(defconstant +oci-fetch-absolute+ #x20) ; absolute offset from first -(defconstant +oci-fetch-relative+ #x40) ; offset relative to current - -;-Bind and Define Options- - -(defconstant +OCI-SB2-IND-PTR+ #x01) ; unused -(defconstant +OCI-DATA-AT-EXEC+ #x02) ; data at execute time -(defconstant +OCI-DYNAMIC-FETCH+ #x02) ; fetch dynamically -(defconstant +OCI-PIECEWISE+ #x04) ; piecewise DMLs or fetch -;- - -;-Execution Modes- -(defconstant +OCI-BATCH-MODE+ #x01) ; batch the oci statement for execution -(defconstant +OCI-EXACT-FETCH+ #x02) ; fetch the exact rows specified -(defconstant +OCI-KEEP-FETCH-STATE+ #x04) ; unused -(defconstant +OCI-SCROLLABLE-CURSOR+ #x08) ; cursor scrollable -(defconstant +OCI-DESCRIBE-ONLY+ #x10) ; only describe the statement -(defconstant +OCI-COMMIT-ON-SUCCESS+ #x20) ; commit, if successful execution -;- - -;-Authentication Modes- -(defconstant +OCI-MIGRATE+ #x0001) ; migratable auth context -(defconstant +OCI-SYSDBA+ #x0002) ; for SYSDBA authorization -(defconstant +OCI-SYSOPER+ #x0004) ; for SYSOPER authorization -(defconstant +OCI-PRELIM-AUTH+ #x0008) ; for preliminary authorization -;- - -;-Piece Information- -(defconstant +OCI-PARAM-IN+ #x01) ; in parameter -(defconstant +OCI-PARAM-OUT+ #x02) ; out parameter -;- - -;- Transaction Start Flags - -; NOTE: OCI-TRANS-JOIN and OCI-TRANS-NOMIGRATE not supported in 8.0.X -(defconstant +OCI-TRANS-NEW+ #x00000001) ; starts a new transaction branch -(defconstant +OCI-TRANS-JOIN+ #x00000002) ; join an existing transaction -(defconstant +OCI-TRANS-RESUME+ #x00000004) ; resume this transaction -(defconstant +OCI-TRANS-STARTMASK+ #x000000ff) - - -(defconstant +OCI-TRANS-READONLY+ #x00000100) ; starts a readonly transaction -(defconstant +OCI-TRANS-READWRITE+ #x00000200) ; starts a read-write transaction -(defconstant +OCI-TRANS-SERIALIZABLE+ #x00000400) - ; starts a serializable transaction -(defconstant +OCI-TRANS-ISOLMASK+ #x0000ff00) - -(defconstant +OCI-TRANS-LOOSE+ #x00010000) ; a loosely coupled branch -(defconstant +OCI-TRANS-TIGHT+ #x00020000) ; a tightly coupled branch -(defconstant +OCI-TRANS-TYPEMASK+ #x000f0000) ; - -(defconstant +OCI-TRANS-NOMIGRATE+ #x00100000) ; non migratable transaction - -;- - -;- Transaction End Flags - -(defconstant +OCI-TRANS-TWOPHASE+ #x01000000) ; use two phase commit -;- - -;; AQ Constants -;; NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE -;; The following constants must match the PL/SQL dbms-aq constants -;; NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE - -; - Visibility flags - -(defconstant +OCI-ENQ-IMMEDIATE+ 1) ; enqueue is an independent transaction -(defconstant +OCI-ENQ-ON-COMMIT+ 2) ; enqueue is part of current transaction - -; - Dequeue mode flags - -(defconstant +OCI-DEQ-BROWSE+ 1) ; read message without acquiring a lock -(defconstant +OCI-DEQ-LOCKED+ 2) ; read and obtain write lock on message -(defconstant +OCI-DEQ-REMOVE+ 3) ; read the message and delete it - -; - Dequeue navigation flags - -(defconstant +OCI-DEQ-FIRST-MSG+ 1) ; get first message at head of queue -(defconstant +OCI-DEQ-NEXT-MSG+ 3) ; next message that is available -(defconstant +OCI-DEQ-NEXT-TRANSACTION+ 2) ; get first message of next txn group - -; - Message states - -(defconstant +OCI-MSG-WAITING+ 1) ; the message delay has not yet completed -(defconstant +OCI-MSG-READY+ 0) ; the message is ready to be processed -(defconstant +OCI-MSG-PROCESSED+ 2) ; the message has been processed -(defconstant +OCI-MSG-EXPIRED+ 3) ; message has moved to exception queue - -; - Sequence deviation - -(defconstant +OCI-ENQ-BEFORE+ 2) ; enqueue message before another message -(defconstant +OCI-ENQ-TOP+ 3) ; enqueue message before all messages - -; - Visibility flags - -(defconstant +OCI-DEQ-IMMEDIATE+ 1) ; dequeue is an independent transaction -(defconstant +OCI-DEQ-ON-COMMIT+ 2) ; dequeue is part of current transaction - -; - Wait - -(defconstant +OCI-DEQ-WAIT-FOREVER+ -1) ; wait forever if no message available -(defconstant +OCI-DEQ-NO-WAIT+ 0) ; do not wait if no message is available - -; - Delay - -(defconstant +OCI-MSG-NO-DELAY+ 0) ; message is available immediately - -;; Expiration -(defconstant +OCI-MSG-NO-EXPIRATION+ -1) ; message will never expire - -;; Describe Handle Parameter Attributes -;; Attributes common to Columns and Stored Procs - -(defconstant +oci-attr-data-size+ 1) ; maximum size of the data -(defconstant +oci-attr-data-type+ 2) ; the sql type of the column/argument -(defconstant +oci-attr-disp-size+ 3) ; the display size -(defconstant +oci-attr-name+ 4) ; the name of the column/argument -(defconstant +oci-attr-precision+ 5) ; precision if number type -(defconstant +oci-attr-scale+ 6) ; scale if number type -(defconstant +oci-attr-is-null+ 7) ; is it null ? -(defconstant +oci-attr-type-name+ 8) - -;; name of the named data type or a package name for package private types - -(defconstant +OCI-ATTR-SCHEMA-NAME+ 9) ; the schema name -(defconstant +OCI-ATTR-SUB-NAME+ 10) ; type name if package private type -(defconstant +OCI-ATTR-POSITION+ 11) ; relative position of col/arg in the list of cols/args - -; complex object retrieval parameter attributes -(defconstant +OCI-ATTR-COMPLEXOBJECTCOMP-TYPE+ 50) ; -(defconstant +OCI-ATTR-COMPLEXOBJECTCOMP-TYPE-LEVEL+ 51) ; -(defconstant +OCI-ATTR-COMPLEXOBJECT-LEVEL+ 52) ; -(defconstant +OCI-ATTR-COMPLEXOBJECT-COLL-OUTOFLINE+ 53) ; - -; Only Columns -(defconstant +OCI-ATTR-DISP-NAME+ 100) ; the display name - -;; stored procs - -(defconstant +OCI-ATTR-OVERLOAD+ 210) ; is this position overloaded -(defconstant +OCI-ATTR-LEVEL+ 211) ; level for structured types -(defconstant +OCI-ATTR-HAS-DEFAULT+ 212) ; has a default value -(defconstant +OCI-ATTR-IOMODE+ 213) ; in, out inout -(defconstant +OCI-ATTR-RADIX+ 214) ; returns a radix -(defconstant +OCI-ATTR-NUM-ARGS+ 215) ; total number of arguments - -;; named type attributes - -(defconstant +oci-attr-typecode+ 216) ; lobject or collection -(defconstant +oci-attr-collection-typecode+ 217) ; varray or nested table -(defconstant +oci-attr-version+ 218) ; user assigned version -(defconstant +oci-attr-is-incomplete-type+ 219) ; is this an incomplete type -(defconstant +oci-attr-is-system-type+ 220) ; a system type -(defconstant +oci-attr-is-predefined-type+ 221) ; a predefined type -(defconstant +oci-attr-is-transient-type+ 222) ; a transient type -(defconstant +oci-attr-is-system-generated-type+ 223) ; system generated type -(defconstant +oci-attr-has-nested-table+ 224) ; contains nested table attr -(defconstant +oci-attr-has-lob+ 225) ; has a lob attribute -(defconstant +oci-attr-has-file+ 226) ; has a file attribute -(defconstant +oci-attr-collection-element+ 227) ; has a collection attribute -(defconstant +oci-attr-num-type-attrs+ 228) ; number of attribute types -(defconstant +oci-attr-list-type-attrs+ 229) ; list of type attributes -(defconstant +oci-attr-num-type-methods+ 230) ; number of type methods -(defconstant +oci-attr-list-type-methods+ 231) ; list of type methods -(defconstant +oci-attr-map-method+ 232) ; map method of type -(defconstant +oci-attr-order-method+ 233) ; order method of type - -; only collection element -(defconstant +OCI-ATTR-NUM-ELEMS+ 234) ; number of elements - -; only type methods -(defconstant +OCI-ATTR-ENCAPSULATION+ 235) ; encapsulation level -(defconstant +OCI-ATTR-IS-SELFISH+ 236) ; method selfish -(defconstant +OCI-ATTR-IS-VIRTUAL+ 237) ; virtual -(defconstant +OCI-ATTR-IS-INLINE+ 238) ; inline -(defconstant +OCI-ATTR-IS-CONSTANT+ 239) ; constant -(defconstant +OCI-ATTR-HAS-RESULT+ 240) ; has result -(defconstant +OCI-ATTR-IS-CONSTRUCTOR+ 241) ; constructor -(defconstant +OCI-ATTR-IS-DESTRUCTOR+ 242) ; destructor -(defconstant +OCI-ATTR-IS-OPERATOR+ 243) ; operator -(defconstant +OCI-ATTR-IS-MAP+ 244) ; a map method -(defconstant +OCI-ATTR-IS-ORDER+ 245) ; order method -(defconstant +OCI-ATTR-IS-RNDS+ 246) ; read no data state method -(defconstant +OCI-ATTR-IS-RNPS+ 247) ; read no process state -(defconstant +OCI-ATTR-IS-WNDS+ 248) ; write no data state method -(defconstant +OCI-ATTR-IS-WNPS+ 249) ; write no process state - -; describing public objects -(defconstant +OCI-ATTR-DESC-PUBLIC+ 250) ; public object -;- - -;-OCIPasswordChange- -(defconstant +OCI-AUTH+ #x08) ; Change the password but do not login - - -;-Other Constants- -(defconstant +OCI-MAX-FNS+ 100) ; max number of OCI Functions -(defconstant +OCI-SQLSTATE-SIZE+ 5) ; -(defconstant +OCI-ERROR-MAXMSG-SIZE+ 1024) ; max size of an error message -;; (defconstant +OCI-LOBMAXSIZE+ 4MAXVAL) ; maximum lob data size -(defconstant +OCI-ROWID-LEN+ 23) ; -;- - -;- Fail Over Events - -(defconstant +OCI-FO-END+ #x00000001) ; -(defconstant +OCI-FO-ABORT+ #x00000002) ; -(defconstant +OCI-FO-REAUTH+ #x00000004) ; -(defconstant +OCI-FO-BEGIN+ #x00000008) ; -(defconstant +OCI-FO-ERROR+ #x00000010) ; -;- - -;- Fail Over Types - -(defconstant +OCI-FO-NONE+ #x00000001) ; -(defconstant +OCI-FO-SESSION+ #x00000002) ; -(defconstant +OCI-FO-SELECT+ #x00000004) ; -(defconstant +OCI-FO-TXNAL+ #x00000008) ; -;- - -;-Function Codes- -(defconstant +OCI-FNCODE-INITIALIZE+ 1) ; OCIInitialize -(defconstant +OCI-FNCODE-HANDLEALLOC+ 2) ; OCIHandleAlloc -(defconstant +OCI-FNCODE-HANDLEFREE+ 3) ; OCIHandleFree -(defconstant +OCI-FNCODE-DESCRIPTORALLOC+ 4) ; OCIDescriptorAlloc -(defconstant +OCI-FNCODE-DESCRIPTORFREE+ 5) ; OCIDescriptorFree -(defconstant +OCI-FNCODE-ENVINIT+ 6) ; OCIEnvInit -(defconstant +OCI-FNCODE-SERVERATTACH+ 7) ; OCIServerAttach -(defconstant +OCI-FNCODE-SERVERDETACH+ 8) ; OCIServerDetach -; unused 9 -(defconstant +OCI-FNCODE-SESSIONBEGIN+ 10) ; OCISessionBegin -(defconstant +OCI-FNCODE-SESSIONEND+ 11) ; OCISessionEnd -(defconstant +OCI-FNCODE-PASSWORDCHANGE+ 12) ; OCIPasswordChange -(defconstant +OCI-FNCODE-STMTPREPARE+ 13) ; OCIStmtPrepare - ; unused 14- 16 -(defconstant +OCI-FNCODE-BINDDYNAMIC+ 17) ; OCIBindDynamic -(defconstant +OCI-FNCODE-BINDOBJECT+ 18) ; OCIBindObject - ; 19 unused -(defconstant +OCI-FNCODE-BINDARRAYOFSTRUCT+ 20) ; OCIBindArrayOfStruct -(defconstant +OCI-FNCODE-STMTEXECUTE+ 21) ; OCIStmtExecute - ; unused 22-24 -(defconstant +OCI-FNCODE-DEFINEOBJECT+ 25) ; OCIDefineObject -(defconstant +OCI-FNCODE-DEFINEDYNAMIC+ 26) ; OCIDefineDynamic -(defconstant +OCI-FNCODE-DEFINEARRAYOFSTRUCT+ 27) ; OCIDefineArrayOfStruct -(defconstant +OCI-FNCODE-STMTFETCH+ 28) ; OCIStmtFetch -(defconstant +OCI-FNCODE-STMTGETBIND+ 29) ; OCIStmtGetBindInfo - ; 30, 31 unused -(defconstant +OCI-FNCODE-DESCRIBEANY+ 32) ; OCIDescribeAny -(defconstant +OCI-FNCODE-TRANSSTART+ 33) ; OCITransStart -(defconstant +OCI-FNCODE-TRANSDETACH+ 34) ; OCITransDetach -(defconstant +OCI-FNCODE-TRANSCOMMIT+ 35) ; OCITransCommit - ; 36 unused -(defconstant +OCI-FNCODE-ERRORGET+ 37) ; OCIErrorGet -(defconstant +OCI-FNCODE-LOBOPENFILE+ 38) ; OCILobFileOpen -(defconstant +OCI-FNCODE-LOBCLOSEFILE+ 39) ; OCILobFileClose - ; 40 was LOBCREATEFILE, unused - ; 41 was OCILobFileDelete, unused -(defconstant +OCI-FNCODE-LOBCOPY+ 42) ; OCILobCopy -(defconstant +OCI-FNCODE-LOBAPPEND+ 43) ; OCILobAppend -(defconstant +OCI-FNCODE-LOBERASE+ 44) ; OCILobErase -(defconstant +OCI-FNCODE-LOBLENGTH+ 45) ; OCILobGetLength -(defconstant +OCI-FNCODE-LOBTRIM+ 46) ; OCILobTrim -(defconstant +OCI-FNCODE-LOBREAD+ 47) ; OCILobRead -(defconstant +OCI-FNCODE-LOBWRITE+ 48) ; OCILobWrite - ; 49 unused -(defconstant +OCI-FNCODE-SVCCTXBREAK+ 50) ; OCIBreak -(defconstant +OCI-FNCODE-SERVERVERSION+ 51) ; OCIServerVersion -; unused 52, 53 -(defconstant +OCI-FNCODE-ATTRGET+ 54) ; OCIAttrGet -(defconstant +OCI-FNCODE-ATTRSET+ 55) ; OCIAttrSet -(defconstant +OCI-FNCODE-PARAMSET+ 56) ; OCIParamSet -(defconstant +OCI-FNCODE-PARAMGET+ 57) ; OCIParamGet -(defconstant +OCI-FNCODE-STMTGETPIECEINFO+ 58) ; OCIStmtGetPieceInfo -(defconstant +OCI-FNCODE-LDATOSVCCTX+ 59) ; OCILdaToSvcCtx - ; 60 unused -(defconstant +OCI-FNCODE-STMTSETPIECEINFO+ 61) ; OCIStmtSetPieceInfo -(defconstant +OCI-FNCODE-TRANSFORGET+ 62) ; OCITransForget -(defconstant +OCI-FNCODE-TRANSPREPARE+ 63) ; OCITransPrepare -(defconstant +OCI-FNCODE-TRANSROLLBACK+ 64) ; OCITransRollback -(defconstant +OCI-FNCODE-DEFINEBYPOS+ 65) ; OCIDefineByPos -(defconstant +OCI-FNCODE-BINDBYPOS+ 66) ; OCIBindByPos -(defconstant +OCI-FNCODE-BINDBYNAME+ 67) ; OCIBindByName -(defconstant +OCI-FNCODE-LOBASSIGN+ 68) ; OCILobAssign -(defconstant +OCI-FNCODE-LOBISEQUAL+ 69) ; OCILobIsEqual -(defconstant +OCI-FNCODE-LOBISINIT+ 70) ; OCILobLocatorIsInit -; 71 was lob locator size in beta2 -(defconstant +OCI-FNCODE-LOBENABLEBUFFERING+ 71) ; OCILobEnableBuffering -(defconstant +OCI-FNCODE-LOBCHARSETID+ 72) ; OCILobCharSetID -(defconstant +OCI-FNCODE-LOBCHARSETFORM+ 73) ; OCILobCharSetForm -(defconstant +OCI-FNCODE-LOBFILESETNAME+ 74) ; OCILobFileSetName -(defconstant +OCI-FNCODE-LOBFILEGETNAME+ 75) ; OCILobFileGetName -(defconstant +OCI-FNCODE-LOGON+ 76) ; OCILogon -(defconstant +OCI-FNCODE-LOGOFF+ 77) ; OCILogoff -(defconstant +OCI-FNCODE-LOBDISABLEBUFFERING+ 78) ; OCILobDisableBuffering -(defconstant +OCI-FNCODE-LOBFLUSHBUFFER+ 79) ; OCILobFlushBuffer -(defconstant +OCI-FNCODE-LOBLOADFROMFILE+ 80) ; OCILobLoadFromFile - - -;- - -;- FILE open modes - -(defconstant +OCI-FILE-READONLY+ 1) ; readonly mode open for FILE types -;- - -;- LOB Buffering Flush Flags - -(defconstant +OCI-LOB-BUFFER-FREE+ 1) ; -(defconstant +OCI-LOB-BUFFER-NOFREE+ 2) ; -;- - -;- OCI Statement Types - - -(defconstant +oci-stmt-select+ 1) ; select statement -(defconstant +oci-stmt-update+ 2) ; update statement -(defconstant +oci-stmt-delete+ 3) ; delete statement -(defconstant +oci-stmt-insert+ 4) ; insert statement -(defconstant +oci-stmt-create+ 5) ; create statement -(defconstant +oci-stmt-drop+ 6) ; drop statement -(defconstant +oci-stmt-alter+ 7) ; alter statement -(defconstant +oci-stmt-begin+ 8) ; begin ... (pl/sql statement) -(defconstant +oci-stmt-declare+ 9) ; declare .. (pl/sql statement ) -;- - -;- OCI Parameter Types - -(defconstant +OCI-PTYPE-UNK+ 0) ; unknown -(defconstant +OCI-PTYPE-TABLE+ 1) ; table -(defconstant +OCI-PTYPE-VIEW+ 2) ; view -(defconstant +OCI-PTYPE-PROC+ 3) ; procedure -(defconstant +OCI-PTYPE-FUNC+ 4) ; function -(defconstant +OCI-PTYPE-PKG+ 5) ; package -(defconstant +OCI-PTYPE-TYPE+ 6) ; user-defined type -(defconstant +OCI-PTYPE-SYN+ 7) ; synonym -(defconstant +OCI-PTYPE-SEQ+ 8) ; sequence -(defconstant +OCI-PTYPE-COL+ 9) ; column -(defconstant +OCI-PTYPE-ARG+ 10) ; argument -(defconstant +OCI-PTYPE-LIST+ 11) ; list -(defconstant +OCI-PTYPE-TYPE-ATTR+ 12) ; user-defined type's attribute -(defconstant +OCI-PTYPE-TYPE-COLL+ 13) ; collection type's element -(defconstant +OCI-PTYPE-TYPE-METHOD+ 14) ; user-defined type's method -(defconstant +OCI-PTYPE-TYPE-ARG+ 15) ; user-defined type method's argument -(defconstant +OCI-PTYPE-TYPE-RESULT+ 16) ; user-defined type method's result -;- - -;- OCI List Types - -(defconstant +OCI-LTYPE-UNK+ 0) ; unknown -(defconstant +OCI-LTYPE-COLUMN+ 1) ; column list -(defconstant +OCI-LTYPE-ARG-PROC+ 2) ; procedure argument list -(defconstant +OCI-LTYPE-ARG-FUNC+ 3) ; function argument list -(defconstant +OCI-LTYPE-SUBPRG+ 4) ; subprogram list -(defconstant +OCI-LTYPE-TYPE-ATTR+ 5) ; type attribute -(defconstant +OCI-LTYPE-TYPE-METHOD+ 6) ; type method -(defconstant +OCI-LTYPE-TYPE-ARG-PROC+ 7) ; type method w/o result argument list -(defconstant +OCI-LTYPE-TYPE-ARG-FUNC+ 8) ; type method w/result argument list - -;; typecodes - -- 2.34.1