Kbase P19543: Dynamic query does not raise error if ambiguous field name is used in prepare string
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  7/6/2005 |
|
Status: Verified
FACT(s) (Environment):
Progress 9.x
OpenEdge 10.x
SYMPTOM(s):
Dynamic query does not raise error if ambiguous field name is used in prepare string
Dynamic query doesn't raise error 72 as expected
** <field> is ambiguous with <table>.<field> and <table>.<field> (72)
Dynamic query returns unexpected results.
CAUSE:
This is expected behavior.
Dynamic queries check their prepare-string entirely at run-time. To keep performance high, they do not perform all the checks that are performed at compile-time for a static query.
Thus, instead of checking if a field name is ambiguous, the dynamic query will simply refer to the first buffer that contains the field name.
FIX:
Avoid using ambiguous field names by always qualifying fields with a table name.