Consultor Eletrônico



Kbase P134488: SQL: Error (7524) creating an SQL VIEW
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   21/08/2008
Status: Unverified

SYMPTOM(s):

SQL: Error (7524) creating an SQL VIEW

Duplicate column specification (7524)

Error is generated executing an SQL CREATE VIEW statement similar to the following:
CREATE VIEW
odbc.myView
AS SELECT
Customer.Name, Alt.Name
FROM
PUB.Customer Customer, PUB.Customer Alt
WHERE
Alt.SalesRep = Customer.SalesRep AND
Alt.CustNum <> Customer.CustNum

FACT(s) (Environment):

All Supported Operating Systems
Progress 9.x
OpenEdge 10.x

CAUSE:

Syntax error: The query attempts to create a VIEW with two columns having the same name. Just as a database table can not have two fields using the same name, the view must have distinct field (column) names.

FIX:

Assign a distinct name for each of the VIEW columns. For example:

CREATE VIEW
odbc.myView (CustName, AltName)
AS SELECT
Customer.Name, Alt.Name
FROM
PUB.Customer Customer, PUB.Customer Alt
WHERE
Alt.SalesRep = Customer.SalesRep AND
Alt.CustNum <> Customer.CustNum