Kbase 19897: AssignQuerySelection Appends to the Existing WHERE Clause
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  10/16/2008 |
|
Status: Unverified
FACT(s) (Environment):
Progress 9.0B
SYMPTOM(s):
ADM2
AssignQuerySelection procedure does not produce the expected results
Wrong results generated by the WHERE clause when you use a new selection criteria with the AssignQuerySelection procedure
CAUSE:
The AssignQuerySelection procedure is used to build up a query's WHERE clause.
The procedure stores intermediate results in the QueryString property before the results are used in the Query-Prepare method.
If the program logic needs to use additional criteria, each time
AssignQuerySelection is run, it appends the additional criteria to the existing WHERE clause.
But if the application needs to use new selection criteria, the AssignQuerySelection generates wrong results which might retrieve an incorrect or no record set at all.
The functions assignQuerySelection and setQuerywhere both adds selection criteria to existing criteria. The new query is stored in a QueryString property that is prepared in the openQuery function.
assignQuerySelection will only change the value of a column in the criteria if it's called a second time with the same column and operator.
The setQueryWhere function blanks out the QueryString property used to store the query and the QueryColumn property used to keep track of the columns' position in the query.
FIX:
In order to use only the new WHERE clause and cancel the previous one, you must use the method 'SetQueryWhere' with a blank value. Add the following line before calling the AssignQuerySelection procedure:
DYNAMIC-FUNCTION('setQueryWhere':U IN h_sdo, INPUT ' ' ).