Kbase P124877: 4GL: Why is quoting constants in a dynamic query PREPARE-STRING allowed?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  19/07/2007 |
|
Status: Unverified
GOAL:
4GL: Why are quoted DECIMAL or INTEGER constants allowed in a dynamic query PREPARE-STRING?
GOAL:
Why does the following statement fails:
OPEN QUERY qCustomer FOR EACH customer NO-LOCK WHERE Balance GT '1000'.
while the following code succeeds:
hQueryHandle:QUERY-PREPARE("FOR EACH Customer NO-LOCK WHERE Balance GT '1000' ").
FACT(s) (Environment):
Progress 9.1x
OpenEdge 10.x
All Supported Operating Systems
FIX:
Since 9.1A, all constants in the PREPARE-STRING of a dynamic query were allowed to be surrounded by quotes no matter what the data type is. Even a quoted "?" evaluates to the unknown value for all non CHARACTER data types when used in the in the context of the Query Object Handle PREPARE-STRING attribute.
This was done by design to enable progress to correctly handle European NUMERIC-FORMAT as well as numeric formats that contain the comma character "," and related cases.
For example, without this enhancement, the following statement would fail:
hQueryHandle:QUERY-PREPARE("FOR EACH Customer NO-LOCK WHERE Balance GT '1,000' ")
and we would not be able to include decimal constants that have embedded commas in them.
This enhancement was not extended to the WHERE clause of a static query or a FOR statement. Hence, using quoted non CHARACTER constants in the WHERE clause of a static query or a FOR statement returns an error.