Add support for MS SQL time data type.

As for the other datetime types we have to use CONVERT at the SQL level in
order to get a format that PostgreSQL understands. This time the magic
number for it is 114.
This commit is contained in:
Dimitri Fontaine 2018-11-23 10:43:58 +01:00
parent 6e325f67e0
commit 801d8a6e09
2 changed files with 2 additions and 1 deletions

View File

@ -95,7 +95,7 @@
(:syb-int8 (mem-ref data :int8))
(:syb-real (mem-ref data :float))
(:syb-flt8 (mem-ref data :double))
((:syb-datetime :syb-datetime4 :syb-msdate)
((:syb-datetime :syb-datetime4 :syb-msdate :syb-mstime)
(with-foreign-pointer (%buf +numeric-buf-sz+)
(let ((count
(%dbconvert %dbproc

View File

@ -201,6 +201,7 @@
Mostly we just use the name, and make try to avoid parsing dates."
(case (intern (string-upcase type) "KEYWORD")
(:time (format nil "convert(varchar, [~a], 114)" name))
(:datetime (format nil "convert(varchar, [~a], 126)" name))
(:smalldatetime (format nil "convert(varchar, [~a], 126)" name))
(:date (format nil "convert(varchar, [~a], 126)" name))