Ignore:
Timestamp:
02/20/2008 05:22:29 AM (18 years ago)
Author:
David Owen <dsowen@…>
branch-nick:
64-bit
parents:
RevTreeChgset
16@64-bit,16[64-bit,16]
2.1.4@64-bit,2.1.4[64-bit,2.1.4]
revision id:
dsowen@fugue88.ws-20080220052229-3uxui9fkezmd5hj9
Message:

Merged from vendor.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 64-bit/src/odbc/parameter.lisp

    r16 r17  
    305305
    306306
     307
     308;;; LOB parameters
     309;;; lob parameters are handled differently, the buffer is not filled with the
     310;;; parameters value but we send data at execution time.
     311;;; This is done with the call:
     312;;; (setf (cffi:mem-ref (slot-value param 'ind-ptr) 'sql-len)
     313;;;              (%sql-len-data-at-exec (length value))))))
     314;;; At execution time the result of %sql-execute or %sql-exec-direct
     315;;; is $SQL_NEED_DATA.
     316;;; The next call to %sql-param-data gives the address of the data buffer
     317;;; of the needed bind parameter.
     318;;; For the LOB parameters we store in this buffer the position of the
     319;;; bind parameter. At execution time we get the buffer address of the
     320;;; bind parameter. From this buffer we retrieve the parameter position
     321;;; and so we know which parameter to send.
     322;;; see functions exec-sql-statement and sql-param-data-position
     323;;; in odbc-main.lisp
     324;;; there is also the Microsoft documentation on SQLPutData, SQLParamData,
     325;;;  SQL_NEED_DATA  and etc.
     326
    307327;;;-----------------------
    308328;;;    clob parameter
     
    315335
    316336(defclass clob-parameter (lob-parameter) ())
    317 
    318337
    319338(defmethod initialize-parameter ((param clob-parameter) args)
     
    325344    ;; the value-ptr will be needed to find the parameter, 
    326345    ;; we store the position there
    327     (setf buffer-length (cffi:foreign-type-size 'sql-pointer))
    328     (setf value-ptr (cffi:foreign-alloc 'sql-pointer))))
     346    (setf buffer-length (cffi:foreign-type-size :long))
     347    (setf value-ptr (cffi:foreign-alloc :long))))
    329348
    330349(defmethod set-parameter-value ((param clob-parameter) value)
     
    375394    ;; the value-ptr will be needed to find the parameter, 
    376395    ;; we store the position there
    377     (setf buffer-length (cffi:foreign-type-size 'sql-pointer))
    378     (setf value-ptr (cffi:foreign-alloc 'sql-pointer))))
     396    (setf buffer-length (cffi:foreign-type-size :long))
     397    (setf value-ptr (cffi:foreign-alloc ':long))))
    379398
    380399(defmethod set-parameter-value ((param uclob-parameter) value)
     
    424443    ;; the value-ptr will be needed to find the parameter,
    425444    ;; we store the position there
    426     (setf buffer-length (cffi:foreign-type-size 'sql-pointer))
    427     (setf value-ptr (cffi:foreign-alloc 'sql-pointer)))
     445    (setf buffer-length (cffi:foreign-type-size :long))
     446    (setf value-ptr (cffi:foreign-alloc :long)))
    428447)
    429448
Note: See TracChangeset for help on using the changeset viewer.