Consultor Eletrônico



Kbase P114619: Progress_recid is being compared incorrectly in a join query by SQL Server DataServer
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   1/25/2007
Status: Unverified

SYMPTOM(s):

Progress_recid is being compared incorrectly in a join query by SQL Server DataServer

The query uses not equal to operator (<>) to compare the Progress_recid value.

The query is as follows:

DEF BUFFER b-cust for customer.
FOR EACH customer WHERE customer.custnum = 1 NO-LOCK,
EACH b-cust WHERE b-cust.custnum = customer.custnum and
recid(b-cust) <> recid(customer) NO-LOCK:
END.

Parsed SQL from the DataServer log file is:

SELECT T0.PROGRESS_RECID unique_id_0,T0.CUSTNUM,T0.U##COUNTRY,T0.
COUNTRY,T0.U##NAME,T0.NAME,T0.ADDRESS,T0.ADDRESS2,T0.CITY,T0.STAT
E,T0.U##POSTALCODE,T0.POSTALCODE,T0.CONTACT,T0.PHONE,T0.U##SALESR
EP,T0.SALESREP,T0.CREDITLIMIT,T0.BALANCE,T0.TERMS,T0.DISCOUNT,T0.
COMMENTS,T0.FAX,T0.EMAILADDRESS,T0.PROGRESS_RECID,T1.PROGRESS_REC
ID unique_id_1,T1.CUSTNUM,T1.U##COUNTRY,T1.COUNTRY,T1.U##NAME,T1.
NAME,T1.ADDRESS,T1.ADDRESS2,T1.CITY,T1.STATE,T1.U##POSTALCODE,T1.
POSTALCODE,T1.CONTACT,T1.PHONE,T1.U##SALESREP,T1.SALESREP,T1.CRED
ITLIMIT,T1.BALANCE,T1.TERMS,T1.DISCOUNT,T1.COMMENTS,T1.FAX,T1.EMA
ILADDRESS,T1.PROGRESS_RECID FROM MAKBAR.CUSTOMER T0,MAKBAR.CUSTOM
ER T1 WHERE ((T0.CUSTNUM = :1 AND T0.CUSTNUM = T1.CUSTNUM AND
T0.PROGRESS_RECID != T0.PROGRESS_RECID))

The parsed SQL for the comparison of progress_recid should be

T0.PROGRESS_RECID != T1.PROGRESS_RECID

CAUSE:

Bug# 20060327-011

FIX:

Upgrade to OpenEdge 10.1B.

Or,

If the upgrade is not possible use the following workaround:

Use IF-THEN-NEXT to get the next record:

DEF BUFFER b-cust for customer.
FOR EACH customer WHERE customer.custnum = 1 NO-LOCK,
EACH b-cust WHERE b-cust.custnum = customer.custnum NO-LOCK:

IF recid(b-cust) = recid(customer) THEN NEXT.

END.