r9491: * db-oracle/oracle-objects.lisp: Add database-get-type-specifier for
[clsql.git] / db-oracle / oracle-sql.lisp
index 8ef460229a203916744008f860aa007f7e5b4ed8..119a669f6db1c744dc282e96195c74ad884eb757 100644 (file)
@@ -395,7 +395,13 @@ the length of that format.")
                           (#.SQLT-FLT  
                            (uffi:deref-array b '(:array :double) irow))
                           (#.SQLT-INT  
-                           (uffi:deref-array b '(:array :int) irow))
+                           (ecase (cd-sizeof cd)
+                             (4
+                              (uffi:deref-array b '(:array :int) irow))
+                             (8
+                              (deref-oci-int64 b irow))
+                             (16
+                              (deref-oci-int128 b irow))))
                           (#.SQLT-DATE 
                            (deref-oci-string b irow (cd-sizeof cd))))))))
               (when (and (eq :string (cd-result-type cd))
@@ -625,11 +631,11 @@ 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 (and (zerop *scale) (not (zerop *precision)))
-                      (and (minusp *scale) (< *precision 10)))
+                 ((or (and (minusp *scale) (zerop *precision))
+                      (and (zerop *scale) (plusp *precision)))
                   (setf buffer (acquire-foreign-resource :int +n-buf-rows+)
                         sizeof 4                       ;; sizeof(int)
                         dtype #.SQLT-INT))