Search found 1 match

by FranklySpeaking
Thu 07 Apr 2022 13:37
Forum: dotConnect for Oracle
Topic: Wrong code generation when querying nullable booleans
Replies: 2
Views: 10467

Wrong code generation when querying nullable booleans

With the property NullableBoolean being a nullable boolen
and the column NullableBoolean being a nullable NUMBER(1)

the query

Code: Select all

Context.SomeTable.Where(t => !(t.NullableBoolean ?? false))
translates to

Code: Select all

FROM SomeTable s
WHERE NOT (COALESCE(s.NullableBoolean, 0))
which is invalid SQL because

Code: Select all

NOT (COALESCE(s.NullableBoolean, 0))
is not a boolean expression.