Consultor Eletrônico



Kbase P95756: Query-prepare fails to find records when using European Number format
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   10/4/2004
Status: Unverified

SYMPTOM(s):

No records are found when using decimal values in a query with European numeric format

Query prepare fails to find any records with European Numeric format

** Unable to understand after -- "<string>". (247)

** Missing file specification after FOR keyword. (235)

PREPARE syntax is: {FOR | PRESELECT} EACH <buf> OF.. WHERE ... etc". (7324)

Using -E or -numsep 46 -numdec 44

CAUSE:

QUERY-PREPARE expects a quoted decimal string with the correct decimal separator. For
example the following fails to find any records with European numeric format, but would work
with American numeric format.:

hQuery:QUERY-PREPARE("FOR EACH gsc_dataset_entity WHERE
gsc_dataset_entity.dataset_entity_obj = 1007600215.08 NO-LOCK").


FIX:

Format the decimal with the Quoter function before passing it to QUERY-PREPARE. e.g.
DEFINE VARIABLE dObj AS DECIMAL NO-UNDO.
DEFINE VARIABLE cObj AS CHARACTER NO-UNDO.
dObj = 1007600215.08.
cObj = QUOTER(dObj).
hQuery:QUERY-PREPARE("FOR EACH gsc_dataset_entity WHERE
gsc_dataset_entity.dataset_entity_obj = " +
cObj + " NO-LOCK").
This method works for sessions started with either American or European numeric formats.