Consultor Eletrônico



Kbase P6941: Query-prepare doesn't support "EUROPEAN" numeric or date format
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   31/07/2006
Status: Unverified

FACT(s) (Environment):

Progress 9.x
Windows NT 32 Intel/Windows 2000

SYMPTOM(s):

Error messages are returned when a dynamic query's WHERE clause is based on a date whose format used is different to that of the session:date-format.

Error 80 and 224 are returned when passing date values to QUERY-PREPARE string.

** The month of a date must be from 1 to 12. (80)

** Unable to convert constant data. (224)

QUERY-OPEN for query requires a previous QUERY-PREPARE. (7312)

Cannot run GET methods on query until it is opened. (7313)

Queries define as:

vQuery = "FOR EACH Invoice NO-LOCK WHERE (Invoice.invoiceDATE >= 01/01/99) AND (Invoice.invoiceDATE <= 31/12/99)".

result in error 80.

CAUSE:

Bug# 19990419-010

FIX:

Upgrade to Progress 9.1A or later where query constants of any data type can be surrounded by quotes. For example:


vQuery = "FOR EACH Invoice NO-LOCK WHERE (Invoice.invoiceDATE >= '01/01/99') AND (Invoice.invoiceDATE <= '31/12/99')".

Alternatively:

There are several work-arounds

The solution is to allow any datatype to be read as a character with the string function and so the variable is built into the query as a string so the compiler does not read the value as incorrect.

The only Work-Arounds are :-
1) Query using the same format as the session:date-format
2) SET SESSION:DATE-FORMAT to the value 's format that will be queried.
3) String the Date value.