Consultor Eletrônico



Kbase P100636: 37000:[Microsoft][ODBC-SQLServer Driver][SQL Server]Line 1: Incorrect syntax near ')'. Running mult
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   2/4/2010
Status: Unverified

SYMPTOM(s):

Error running query using multiline for each

37000:[Microsoft][ODBC-SQLServer Driver][SQL Server]Line 1: Incorrect syntax near ')'.


Code snippet that causes the error
def var templog as logi no-undo init false.

/* OK with this line not commented out */
/* templog = available Vendor. */

/* bad with this line */
MESSAGE "about to start the loop!" VIEW-AS ALERT-BOX.

FOR EACH ExtCompany NO-LOCK
WHERE ExtCompany.Company = "VN10T"
AND ExtCompany.SendVend = YES
AND ((ExtCompany.ExtSystemId = "Multi":U AND AVAILABLE Vendor)
OR ExtCompany.ExtSystemId = "MCONNECT":U),
EACH ExtSystem NO-LOCK WHERE
ExtSystem.ExtSystemID = ExtCompany.ExtSystemID AND
ExtSystem.TransferMethod = ExtCompany.TransferMethod AND
CAN-FIND(ExtSysTable WHERE
ExtSysTable.ExtSystemID = ExtCompany.ExtSystemID AND
ExtSysTable.TableName = "VendorPP":U):

MESSAGE "in the loop!" VIEW-AS ALERT-BOX.

END.

MESSAGE "just left the loop!" VIEW-AS ALERT-BOX.


FACT(s) (Environment):

MS SQL DataServer
Progress 9.1D
Progress 9.1E
OpenEdge 10.0B

CAUSE:

Bug# OE00113363

FIX:

Following code works around the problem
def var templog as logi no-undo init false.

/* OK with this line not commented out */
templog = available Vendor.

/* bad with this line */
MESSAGE "about to start the loop!" VIEW-AS ALERT-BOX.

FOR EACH ExtCompany NO-LOCK
WHERE ExtCompany.Company = "VN10T"
AND ExtCompany.SendVend = YES
AND ((ExtCompany.ExtSystemId = "Multi":U AND AVAILABLE Vendor)
OR ExtCompany.ExtSystemId = "MCONNECT":U),
EACH ExtSystem NO-LOCK WHERE
ExtSystem.ExtSystemID = ExtCompany.ExtSystemID AND
ExtSystem.TransferMethod = ExtCompany.TransferMethod AND
CAN-FIND(ExtSysTable WHERE
ExtSysTable.ExtSystemID = ExtCompany.ExtSystemID AND
ExtSysTable.TableName = "VendorPP":U):

MESSAGE "in the loop!" VIEW-AS ALERT-BOX.

END.

MESSAGE "just left the loop!" VIEW-AS ALERT-BOX.