Index: cffi/doc/documentation.html
===================================================================
--- cffi/doc/documentation.html	(revision cffi,5)
+++ cffi/doc/documentation.html	(revision cffi,6)
@@ -16,5 +16,5 @@
     <p>
       For Information about ODBC-API, I recommend the
-      <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/dasdkodbcoverview.asp">
+      <a href="http://msdn2.microsoft.com/en-us/library/ms710252(VS.85).aspx">
         ODBC documentation from Microsoft</a>.
     </p>
Index: cffi/doc/notes.html
===================================================================
--- cffi/doc/notes.html	(revision cffi,5)
+++ cffi/doc/notes.html	(revision cffi,6)
@@ -281,5 +281,16 @@
 The decimal expansion of 1/7 is periodic, so the digits 0.285 are correct. Thus
 MySQL uses the precision of double, but does not return all digits.
-
+<p>
+
+<h3>The SQL Parser</h3>
+The <tt>/* ..*/</tt> comments do not have to be closed:
+<pre>
+19]> (exec-query *con3* "select 1 as a /*bla")
+
+((1)) ;
+("a")
+</pre>
+Maybe this depends on the version of MySQL or some system parameter.
+</p>
 <h3>Parameters</h3>
 <p>
Index: cffi/src/odbc/odbc-ff-interface.lisp
===================================================================
--- cffi/src/odbc/odbc-ff-interface.lisp	(revision cffi,3)
+++ cffi/src/odbc/odbc-ff-interface.lisp	(revision cffi,6)
@@ -313,5 +313,4 @@
      year)))
 
-
-(defmacro %sql-len-data-at-exec (length)
-  `(- $SQL_LEN_DATA_AT_EXEC_OFFSET ,length))
+(defun %sql-len-data-at-exec (length)
+  (- $SQL_LEN_DATA_AT_EXEC_OFFSET length))
Index: cffi/src/odbc/odbc-main.lisp
===================================================================
--- cffi/src/odbc/odbc-main.lisp	(revision cffi,5)
+++ cffi/src/odbc/odbc-main.lisp	(revision cffi,6)
@@ -467,5 +467,4 @@
 ;; this functions works only, since we store at value-ptr the position
 ;; of the parameter
-;; dso--
 (defun sql-param-data-position (hstmt)
   (with-temporary-allocations
@@ -474,7 +473,7 @@
                    (%sql-param-data hstmt ptr))))
       (values res (if (= res $SQL_NEED_DATA)
-                      (cffi:mem-ref (cffi:mem-ref ptr :pointer) :int32))))))
-                                        ; TODO: The :int32 above
-                                        ; should probably be changed!
+                      (cffi:mem-ref (cffi:mem-ref ptr :pointer) :long))))))
+
+
 
 (defmethod exec-prepared-query ((query prepared-statement) &rest parameters)
Index: cffi/src/odbc/parameter.lisp
===================================================================
--- cffi/src/odbc/parameter.lisp	(revision cffi,3)
+++ cffi/src/odbc/parameter.lisp	(revision cffi,6)
@@ -305,4 +305,24 @@
 
 
+
+;;; LOB parameters
+;;; lob parameters are handled differently, the buffer is not filled with the
+;;; parameters value but we send data at execution time.
+;;; This is done with the call:
+;;; (setf (cffi:mem-ref (slot-value param 'ind-ptr) 'sql-len)
+;;;              (%sql-len-data-at-exec (length value))))))
+;;; At execution time the result of %sql-execute or %sql-exec-direct
+;;; is $SQL_NEED_DATA. 
+;;; The next call to %sql-param-data gives the address of the data buffer 
+;;; of the needed bind parameter.
+;;; For the LOB parameters we store in this buffer the position of the
+;;; bind parameter. At execution time we get the buffer address of the
+;;; bind parameter. From this buffer we retrieve the parameter position
+;;; and so we know which parameter to send.
+;;; see functions exec-sql-statement and sql-param-data-position
+;;; in odbc-main.lisp
+;;; there is also the Microsoft documentation on SQLPutData, SQLParamData, 
+;;;  SQL_NEED_DATA  and etc.
+
 ;;;-----------------------
 ;;;    clob parameter
@@ -315,5 +335,4 @@
 
 (defclass clob-parameter (lob-parameter) ())
-
 
 (defmethod initialize-parameter ((param clob-parameter) args)
@@ -325,6 +344,6 @@
     ;; the value-ptr will be needed to find the parameter,  
     ;; we store the position there
-    (setf buffer-length (cffi:foreign-type-size 'sql-pointer))
-    (setf value-ptr (cffi:foreign-alloc 'sql-pointer))))
+    (setf buffer-length (cffi:foreign-type-size :long))
+    (setf value-ptr (cffi:foreign-alloc :long))))
 
 (defmethod set-parameter-value ((param clob-parameter) value)
@@ -375,6 +394,6 @@
     ;; the value-ptr will be needed to find the parameter,  
     ;; we store the position there
-    (setf buffer-length (cffi:foreign-type-size 'sql-pointer))
-    (setf value-ptr (cffi:foreign-alloc 'sql-pointer))))
+    (setf buffer-length (cffi:foreign-type-size :long))
+    (setf value-ptr (cffi:foreign-alloc ':long))))
 
 (defmethod set-parameter-value ((param uclob-parameter) value)
@@ -384,5 +403,5 @@
     (progn
       (setf (slot-value param 'temp-val) value)
-      (setf (cffi:mem-ref (slot-value param 'value-ptr) ':long)
+      (setf (cffi:mem-ref (slot-value param 'value-ptr) :long)
               (slot-value param 'position))
       (setf (cffi:mem-ref (slot-value param 'ind-ptr) 'sql-len)
@@ -424,6 +443,6 @@
     ;; the value-ptr will be needed to find the parameter, 
     ;; we store the position there
-    (setf buffer-length (cffi:foreign-type-size 'sql-pointer))
-    (setf value-ptr (cffi:foreign-alloc 'sql-pointer)))
+    (setf buffer-length (cffi:foreign-type-size :long))
+    (setf value-ptr (cffi:foreign-alloc :long)))
 )
 
Index: cffi/src/test/test-mysql.lisp
===================================================================
--- cffi/src/test/test-mysql.lisp	(revision cffi,5)
+++ cffi/src/test/test-mysql.lisp	(revision cffi,6)
@@ -40,5 +40,5 @@
 
 create table type_test
-(id int,
+ (id int,
 t_TINYINT TINYINT,
 t_SMALLINT  SMALLINT,
@@ -99,4 +99,5 @@
   --t_LONGBLOB longblob,
   --t_LONGTEXT = lpad('a',33000,'x') 
+*/
   where id =1
 ")
Index: cffi/src/test/test-oracle.lisp
===================================================================
--- cffi/src/test/test-oracle.lisp	(revision cffi,5)
+++ cffi/src/test/test-oracle.lisp	(revision cffi,6)
@@ -144,5 +144,5 @@
                                 '(:string :in) 
                                 '(:string :out))))
-    (let ((str "lölkälkäölkälhjajhgfsjgakjhgfjfjhgffdtrtreztr"))
+    (let ((str "lolkalkxylkzlhjajhgfsjgakjhgfjfjhgffdtrtreztr"))
       (assert (equal str (first (exec-prepared-command stm str))))
       (free-statement stm)))
Index: cffi/src/test/test-sql-server.lisp
===================================================================
--- cffi/src/test/test-sql-server.lisp	(revision cffi,5)
+++ cffi/src/test/test-sql-server.lisp	(revision cffi,6)
@@ -245,5 +245,5 @@
                             '(:string :in) 
                             '(:unicode-string :in))
-    (let* ((strings '("hjgkhgkzt65646&%2" "nnvfdsfsfz6tztß0#="))
+    (let* ((strings '("hjgkhgkzt65646&%2" "nnvfdsfsfz6tztB0#="))
            (res (exec-prepared-query stm (first strings) (second strings))))
       (assert (equal res (list strings))))))
