Hello!
dotConnect builds following SQL fragment for LINQ equals operator :
("Extent2".a = "Extent4".a) OR (("Extent2".a IS NULL) AND ("Extent4".aD IS NULL)
Is it possible to clean “IS NULL” parts?
Leave only "Extent2".a = "Extent4".a
a is not null column
Thanks
"equals" operator in "join" statement. Unwanted SQL code.
Hello
No, It's LINQ to Entity
1. Database creating script
create table t1
(
t1_a1 number(12) not null,
t1_a2 number(12) not null,
constraint pk_t1 primary key (t1_a1)
);
create table t2
(
t2_b1 number(12) not null,
t2_b2 number(12) not null,
constraint pk_t2 primary key (t2_b1)
);
2. Model was generated from database. One-to-One, without modifications.
3. LINQ
from t1 in context.T1
join t2 in context.T2 on t1.T1_A2 equals t2.T2_B1
elect new { t1.T1_A1, t2.T2_B2 };
4. SQL
SELECT
1 AS C1,
"Extent1".T1_A1 AS T1_A1,
"Extent2".T2_B2 AS T2_B2
FROM PXBANK.T1 "Extent1"
INNER JOIN PXBANK.T2 "Extent2" ON ("Extent1".T1_A2 = "Extent2".T2_B1) OR (("Extent1".T1_A2 IS NULL) AND ("Extent2".T2_B1 IS NULL))
It's just example. In real world such SQLs executes extremly slowly.
Could you add option which allow to generate short comparison sql statement ?
("Extent1".T1_A2 = "Extent2".T2_B1) OR (("Extent1".T1_A2 IS NULL) AND ("Extent2".T2_B1 IS NULL))
=====>
("Extent1".T1_A2 = "Extent2".T2_B1
Please.
No, It's LINQ to Entity
1. Database creating script
create table t1
(
t1_a1 number(12) not null,
t1_a2 number(12) not null,
constraint pk_t1 primary key (t1_a1)
);
create table t2
(
t2_b1 number(12) not null,
t2_b2 number(12) not null,
constraint pk_t2 primary key (t2_b1)
);
2. Model was generated from database. One-to-One, without modifications.
3. LINQ
from t1 in context.T1
join t2 in context.T2 on t1.T1_A2 equals t2.T2_B1
elect new { t1.T1_A1, t2.T2_B2 };
4. SQL
SELECT
1 AS C1,
"Extent1".T1_A1 AS T1_A1,
"Extent2".T2_B2 AS T2_B2
FROM PXBANK.T1 "Extent1"
INNER JOIN PXBANK.T2 "Extent2" ON ("Extent1".T1_A2 = "Extent2".T2_B1) OR (("Extent1".T1_A2 IS NULL) AND ("Extent2".T2_B1 IS NULL))
It's just example. In real world such SQLs executes extremly slowly.
Could you add option which allow to generate short comparison sql statement ?
("Extent1".T1_A2 = "Extent2".T2_B1) OR (("Extent1".T1_A2 IS NULL) AND ("Extent2".T2_B1 IS NULL))
=====>
("Extent1".T1_A2 = "Extent2".T2_B1
Please.