- do
- (loop for i from 0 to (1- (min out-len +max-precision+))
- do (setf (aref octets (+ offset i)) (deref-array data-ptr '(:array :unsigned-byte) i))
- finally (incf offset (1- i)))
- while
- (and (= res $SQL_SUCCESS_WITH_INFO)
- (> out-len +max-precision+))
- do
- (setf res (%sql-get-data hstmt column-nr c-type data-ptr +max-precision+ out-len-ptr)
- out-len (deref-pointer out-len-ptr #.$ODBC-LONG-TYPE)))
- (setf str (uffi:octets-to-string octets))
+ do
+ (if (= c-type #.$SQL_CHAR)
+ (setf offset (%cstring-into-vector ;string
+ data-ptr str
+ offset
+ (min out-len (1- +max-precision+))))
+ (error 'clsql:sql-database-error :message "wrong type. preliminary."))
+ while
+ (and (= res $SQL_SUCCESS_WITH_INFO)
+ (>= out-len +max-precision+))
+ do (setf res (%sql-get-data hstmt column-nr c-type data-ptr
+ +max-precision+ out-len-ptr)
+ out-len (get-cast-long out-len-ptr)))