Consultor Eletrônico



Kbase P34890: Syntax error (7587) when the phrase "MATCHES" is used in SQL92 syntax.
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   16/10/2008
Status: Unverified

FACT(s) (Environment):

UNIX
Windows
Progress 9.1x

SYMPTOM(s):

DIAG [37000] [MERANT][ODBC PROGRESS driver][PROGRESS]Syntax error (7587) (-20003)

CAUSE:

The phrase "MATCHES" is not supported by the Progress SQL92 engine.

FIX:

The following is an example of SQL92 syntax that fails:

SELECT iix."Item-code", iix."Item-desc-2", iix."User-def-1", iix."upc-code", iix."Class-code", iix."Item-desc-1", iix."Group-code", iix."unit-track", pro_element(pri."Cust-Price",1,1), pri."Customer" FROM iix INNER JOIN pri ON pri."item-code" = iix."group-code" WHERE iix."Item-code" <> '' AND (iix."User-Def-1" ='A' OR iix."User-Def-1"='C' OR iix."User-Def-1"='S') AND iix."Item-desc-2" <> '' AND iix."upc-code" <> '' AND iix."Item-desc-1" <> '' AND iix."Group-code" <> '' AND iix."Class-code" ='FG1' AND iix."Active-flg" MATCHES '*S*' AND pri."customer" <> '' ORDER BY pri."Customer"

Below is an example of SQL92 syntax that succeeds:

SELECT iix."Item-code", iix."Item-desc-2", iix."User-def-1", iix."upc-code", iix."Class-code", iix."Item-desc-1", iix."Group-code", iix."unit-track", pro_element(pri."Cust-Price",1,1), pri."Customer" FROM iix INNER JOIN pri ON pri."item-code" = iix."group-code" WHERE iix."Item-code" <> '' AND (iix."User-Def-1" ='A' OR iix."User-Def-1"='C' OR iix."User-Def-1"='S') AND iix."Item-desc-2" <> '' AND iix."upc-code" <> '' AND iix."Item-desc-1" <> '' AND iix."Group-code" <> '' AND iix."Class-code" ='FG1' AND iix."Active-flg" LIKE '%S%' AND pri."customer" <> '' ORDER BY pri."Customer"

Notice that the "MATCHES" phrase has been replaced by the "LIKE" phrase. Additionally, the asterisk (*) has been replaced with the percent sign (%) as the wildcard symbol.