Try OpenEdge Now
skip to main content
DataServer for Oracle
RDBMS Stored Procedure Details : Interfacing with RDBMS stored procedures : Retrieving results sets using proc-text-buffer : Technique to use proc-text-buffer
 
Technique to use proc-text-buffer
This example illustrates returning database results into the proc-text-buffer and converting the results to the INTEGER data type.

Returning database results into the proc-text-buffer and converting the results to the INTEGER data type

DEFINE VARIABLE iHandle AS INTEGER NO-UNDO.
DEFINE VARIABLE iMax    AS INTEGER NO-UNDO.

RUN STORED-PROC send-sql-statement iHandle = PROC-HANDLE
  ("SELECT max (custnum) FROM customer").
FOR EACH proc-text-buffer:
   iMax = INTEGER(SUBSTRING(proc-text, 1, 3)).
    DISPLAY iMax.
END.
CLOSE STORED-PROC send-sql-statement WHERE PROC-HANDLE = iHandle.
The DataServer passes the PL/SQL statement directly to the Oracle data source. The ABL compiler does not process it, so errors occur only at run time and not when you compile a procedure.