X-Git-Url: http://git.kpe.io/?a=blobdiff_plain;f=db-oracle%2Foracle-sql.lisp;h=f71b7f772836820ea7cb0b30938de3792e3a22e3;hb=e622ee6f4bf2b9fe81af59d566e651c983a4833b;hp=3c6c226592edbd3d26c27ca7a69ba626320aef63;hpb=99df5f6ad5b46a65d5698ebb85f95fa71f861da5;p=clsql.git diff --git a/db-oracle/oracle-sql.lisp b/db-oracle/oracle-sql.lisp index 3c6c226..f71b7f7 100644 --- a/db-oracle/oracle-sql.lisp +++ b/db-oracle/oracle-sql.lisp @@ -51,8 +51,8 @@ likely that we'll have to worry about the CMUCL limit.")) (eval-when (:compile-toplevel :load-toplevel :execute) (defconstant SQLT-NUMBER 2) (defconstant SQLT-INT 3) - (defconstant SQLT-STR 5) (defconstant SQLT-FLT 4) + (defconstant SQLT-STR 5) (defconstant SQLT-DATE 12)) ;;; Note that despite the suggestive class name (and the way that the @@ -105,7 +105,7 @@ output format. In order to extract date strings from output buffers holding multiple date strings in fixed-width fields, we need to know the length of that format.") (server-version - :type string + :type (or null string) :initarg :server-version :reader server-version :documentation @@ -117,7 +117,7 @@ the length of that format.") :documentation "The major version number of the Oracle server, should be 8, 9, or 10") (client-version - :type string + :type (or null string) :initarg :client-version :reader client-version :documentation @@ -657,9 +657,10 @@ the length of that format.") (deref-vp errhp)) (let ((*scale (uffi:deref-pointer scale :byte)) (*precision (uffi:deref-pointer precision :byte))) - ;;(format t "scale=~d, precision=~d~%" *scale *precision) + + ;; (format t "scale=~d, precision=~d~%" *scale *precision) (cond - ((or (zerop *scale) + ((or (and (zerop *scale) (not (zerop *precision))) (and (minusp *scale) (< *precision 10))) (setf buffer (acquire-foreign-resource :int +n-buf-rows+) sizeof 4 ;; sizeof(int) @@ -910,18 +911,14 @@ 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 oracle-database)) (execute-command - (concatenate 'string "CREATE SEQUENCE " - (sql-escape sequence-name)) + (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 oracle-database)) (execute-command - (concatenate 'string "DROP SEQUENCE " - (sql-escape sequence-name)) + (concatenate 'string "DROP SEQUENCE " (sql-escape sequence-name)) :database database)) (defmethod database-sequence-next (sequence-name (database oracle-database)) @@ -933,7 +930,8 @@ the length of that format.") ) database :auto nil))) -(defmethod database-set-sequence-position (name position database) +;; FIXME: use lock +(defmethod database-set-sequence-position (name position (database oracle-database)) (let* ((next (database-sequence-next name database)) (incr (- position next))) (database-execute-command @@ -1025,7 +1023,8 @@ the length of that format.") list))) (defmethod clsql-sys:database-start-transaction ((database oracle-database)) - (call-next-method)) + (call-next-method) + ) ;;(with-slots (svchp errhp) database ;; (osucc (oci-trans-start (uffi:deref-pointer svchp)