cancel
Showing results for 
Search instead for 
Did you mean: 

HANA and parametrized query with different results for same parameters

Alex_D
Explorer
251

Hello everyone,

I have here a custom CDS view. Depending on, how the where clause is created, the result is either 2 or 4 lines

Result with 2 lines (everywhere is select * from ....) :

WHERE "MANDT" = ? AND "INSPECTIONCHARACTERISTIC" = ? AND "MATERIALSAMPLE" = ? AND ( "WORKCENTER" = ? OR "WORKCENTER" = ? )

Result with 4 lines:
WHERE "MANDT" = ? AND ( "MATERIALSAMPLE" = ? AND "WORKCENTER" = ? OR "MATERIALSAMPLE" = ? AND "WORKCENTER" = ? ) AND "INSPECTIONCHARACTERISTIC" = ?


Parameters:
Mandt: 100
INSPECTIONCHARACTERISTIC: 0010
MATERIALSAMPLE: 000900004026
WORKCENTER: LAB_WK1 and LAB_WK2

Funny, that

"MANDT" = '100' AND ( "MATERIALSAMPLE" = '000900004026' AND "WORKCENTER" = 'LAB_WK1' OR MATERIALSAMPLE" = '000900004026' AND "WORKCENTER" = 'LAB_WK2' ) AND "INSPECTIONCHARACTERISTIC" = '0010'

returns only 2 lines.
Bug? or Feature? (Ticket is opened already, but anyway)...

Alex_D
Explorer
0 Kudos

there is OR between two ANDs, not AND.

The 3rd query is same as the second one and not parametrized: the resultset is 2 lines..

The second query is generated by SADL Engine, actually. I have the records duplication problem in Fiori application and have traced down the place, where the query is executed against the DB.

Accepted Solutions (0)

Answers (0)