Kbase P134323: DOC: Ambiguous statement related to the raising of errors when the QUERY-PREPARE( ) method fails.
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  8/18/2008 |
|
Status: Unverified
SYMPTOM(s):
DOC: Ambiguous statement related to the raising of errors when the QUERY-PREPARE( ) method fails.
The statement:
If the QUERY-PREPARE method encounters an error, it returns FALSE and does not raise an error.
incorrectly implies that an error is not generated.
What is not raised is the error condition that sets the ERROR-STATUS:ERROR to YES. But the error itself is generated regardless of whether we use the NO-ERROR option or not.
For example, running the following code without the NO-ERROR option generates error (3322):
DEFINE VARIABLE hQuery AS WIDGET-HANDLE.
DEFINE VARIABLE hBuffer AS WIDGET-HANDLE.
DEFINE VARIABLE lResult AS LOGICAL NO-UNDO.
CREATE BUFFER hBuffer FOR TABLE "customer".
CREATE QUERY hQuery.
hQuery:SET-BUFFERS(hBuffer).
lResult = hQuery:QUERY-PREPARE("for customer").
Also, running the following code with the NO-ERROR option generates the same error:
DEFINE VARIABLE hQuery AS WIDGET-HANDLE.
DEFINE VARIABLE hBuffer AS WIDGET-HANDLE.
DEFINE VARIABLE lResult AS LOGICAL NO-UNDO.
CREATE BUFFER hBuffer FOR TABLE "customer".
CREATE QUERY hQuery.
hQuery:SET-BUFFERS(hBuffer).
lResult = hQuery:QUERY-PREPARE("for customer") NO-ERROR.
MESSAGE ERROR-STATUS:GET-MESSAGE(1)
VIEW-AS ALERT-BOX INFO BUTTONS OK.
FACT(s) (Environment):
All Supported Operating Systems
OpenEdge 10.x
CAUSE:
Bug# OE00173470
FIX:
None at this time.
As a workaround, the statement should read as follows:
If the QUERY-PREPARE method encounters an error, it returns FALSE and does not raise the ERROR condition or set the ERROR-STATUS:ERROR attribute to yes.