Skip to content

Cannot query for time only variables #559

@rPraml

Description

@rPraml

Driver version or jar name

latest (6.3.5)

SQL Server version

SQL Server 14.0.3006

Client operating system

Windows

Java/JVM version

Example: java version "1.8.x", Oracle VM

Table schema

create table dateandtime (id integer not null, 
 my_date date, 
 my_time time, 
 my_timestamp datetime2 
 constraint pk_esimple primary key (id))

Problem description

A prepared statement with select * from dateandtime where my_time = ? and pstmt.setTime(1,...) fails with com.microsoft.sqlserver.jdbc.SQLServerException: The data types time and datetime are incompatible in the equal to operator.

Expected behavior and actual behavior

Query with Time should work

Repro code

See #558

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions