Consultor Eletrônico



Kbase P96663: SQL-92: error 7520 when running a query with an alias specified in an ORDER BY clause
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   24/10/2004
Status: Unverified

FACT(s) (Environment):

Progress 9.1x

SYMPTOM(s):

Column not found/specified (7520)

Using JDBC or ODBC Client

An alias is created from a calculated field

The alias created is specified in the ORDER BY clause:
Ex: SELECT Region + Statename AS MyCol
FROM pub.state
ORDER BY MyCol

FIX:

This is expected behavior. Progress 9.1x does not support references to calculated column in the ORDER BY clause.
To workaround this limitation, the set of calculated fields has to be specified in the ORDER BY clause. The example above can be workarounded as follows:
SELECT Region + Statename AS MyCol
FROM pub.state
ORDER BY Region + Statename