Hi,
I got a problem with 5.1.6 that we didn't see with 3.51
the query (executed from MS Excel MS query):
SELECT
A.MATNR,
A.TYPE,
A.NAME,
J.DELAY,
J.ORDER_INVOICE,
J.ROW_NO,
J.UNITS,
A.PRIOR,
J.HOLD_STATUS,
J.CUSTOMERCODE,
J.COUNTRY,
A.ACQPLANT,
A.DAY_DSALDO_PLUS_AR,
J.CONFIRMED_DEL_DATE,
J.REQUESTED_DEL_DATE,
J.DELIVERY_BLOCK,
CASE WHEN 1=1 THEN D.MRP_CONT END AS TRP_MRP_CONT,
D2.MRP_CONT AS HUA_MRP_CONT
FROM ACTADW.JM2ORDSTOCKDAY J
INNER JOIN ACTADW.CB1ARTSTATDAY A ON
A.MATNR = J.PRODUCTNO
AND J.PLANT = '0101'
LEFT OUTER JOIN ACTADW.DB3ARTSTATDAY D ON
D.MATNR = J.PRODUCTNO
AND D.PLANT = '1100'
LEFT OUTER JOIN CPDDW.DB9ARTSTATDAY D2 ON
D2.MATNR = J.PRODUCTNO
AND D2.PLANT = '6100'
WHERE A.DAY_DSALDO_PLUS_AR < 0 AND J.HOLD_STATUS <> 'NO_INVOICE'
AND (J.DELAY < -10 AND J.PRIO = 1 OR J.DELAY < 8 AND J.PRIO <> 1)
Bombs out with error msg - Didn't expect '1' after Select column list
It is the case 1=1... that is the culprit, I'm told we use the case 1=1... to circumvent some kind of error
Now my problem is when I try to strip down the query to pinpoint the bug I get inconsistent results. The query above always fails. With stripped down variants the error either disapears or only shows randomly!
NOTA BENE! for version 3.51 this query always runs OK!
If I prefix the query with a comment like /* */ it runs OK in 5.1.6.
I write this in hope someone can tell me what's going on, or can guide me how to debug this so I can write a proper bug report or tell me what I do wrong.