Add support for "datetime2" data type in MS SQL.

That's a blind fix, or almost blind: we're given some information but I'm
not in a position to test the fix myself. Hope it works.

Fixes #1036.
Fixes #1018.
This commit is contained in:
Dimitri Fontaine 2020-02-29 22:23:58 +01:00
parent df94340396
commit 30376b2cfe
2 changed files with 6 additions and 1 deletions

View File

@ -95,7 +95,11 @@
(: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-mstime)
((:syb-datetime
:syb-datetime4
:syb-msdate
:syb-mstime
:syb-msdatetime2)
(with-foreign-pointer (%buf +numeric-buf-sz+)
(let ((count
(%dbconvert %dbproc

View File

@ -170,6 +170,7 @@
(case (intern (string-upcase type) "KEYWORD")
(:time (format nil "convert(varchar, [~a], 114)" name))
(:datetime (format nil "convert(varchar, [~a], 126)" name))
(:datetime2 (format nil "convert(varchar, [~a], 126)" name))
(:smalldatetime (format nil "convert(varchar, [~a], 126)" name))
(:date (format nil "convert(varchar, [~a], 126)" name))
(:bigint (format nil "cast([~a] as numeric)" name))