![]() | ![]() |
Home |
|
|
Troubleshooting and Error Messages Guide |
|
| Chapter 3 Error Message Writeups |
|
| Query Processor Errors |
|
| Error 301 |
16
Query contains an illegal outer-join request.
Error 301 is raised in the following scenario:
the select clause of a query contains one or more correlated subqueries, and
the subquery contains an outer join clause, and
a correlated column is an outer join operand.
For example:
select t2.b1, (select t2.b2 from t1 where t2.b1 *= t1.a1) from t2
Column t2.b1 is an outer join operand. This violates Transact-SQL query semantics, since correlated variables are not allowed to participate in an outer join.
Some ASE versions report Error 11013 ("
Correlated columns are not allowed in the outer join clause of the subquery.") or Error 11055 ("
Query contains an illegal outer-join request.") instead.
Rewrite the query to use an ANSI outer join:
select t2.b1, (select t2.b2 from t2 left outer join t1 on t2.b1 = t1.a1) from t2
As an alternative, you can replace the outer join with an equijoin; that is, replace '*=' with '='.
All versions
|
|