PreviousNextIndex

CLOSE STORED-PROCEDURE statement

For a non-ABL stored procedure, indicates that the procedure has completed execution and retrieves any return status. For a send-sql-statement stored procedure, closes the SQL cursor used by the procedure.

Syntax

CLOSE STORED-PROCEDURE procedure 
  [ integer-field = PROC-STATUS ] 
  [ WHERE PROC-HANDLE = integer-field ] 

procedure
integer-field = PROC-STATUS
WHERE PROC-HANDLE = integer-field
Example

The PROC-STATUS clause of the CLOSE STORED-PROCEDURE statement allows the DataServer for ORACLE to retrieve the text of an ORACLE error message that was passed to raise_application_error. Use the ERROR-STATUS:GET-MESSAGE handle to retrieve the message, as shown in the following example:

DEFINE VARIABLE st AS INTEGER NO-UNDO. 
DEFINE VARIABLE h  AS INTEGER NO-UNDO. 
RUN STORED-PROC p1 h = PROC-HANDLE NO-ERROR. 
CLOSE STORED-PROC p1 st = PROC-STATUS WHERE PROC-HANDLE = h.  
DISPLAY st. 
IF ERROR-STATUS:ERROR THEN 
  MESSAGE ERROR-STATUS:GET-MESSAGE(1) ERROR-STATUS:GET-NUMBER(1) 
    VIEW-AS ALERT-BOX.  

Notes
See also

PROC-HANDLE function, PROC-STATUS function, RUN STORED-PROCEDURE statement


OpenEdge Release 10.2B
Copyright © 2009 Progress Software Corporation
PreviousNextIndex