Try OpenEdge Now
skip to main content
DataServer for Microsoft SQL Server
RDBMS Stored Procedure Details : Run Stored-Procedure details : Run Stored-Proc statement execution with the LOAD-RESULT-INTO phrase
 

Run Stored-Proc statement execution with the LOAD-RESULT-INTO phrase

You can also execute a stored procedure implementation to obtain result sets and load the results into temp-tables. You must define result set(s) target as part of the RUN STORED-PROC statement. You do not explicitly close a STORED-PROC defined this way as you do with buffer methods of retrieving result sets; the LOAD-RESULT-INTO function achieves this goal implicitly.
This is the syntax for the RUN STORED-PROC statement implementation when loading result sets to temp-tables:
RUN STORED-PROC procedure-name

[ [ LOAD-RESULT-INTO handle [ int = PROC-STATUS ]]
     [NO-ERROR]
    [ ( [ INPUT | OUTPUT | INPUT OUTPUT ]
[ PARAM parameter-name = ] expression, ...
       [ INPUT | OUTPUT | INPUT OUTPUT ]
[ PARAM parameter-name = ] expression) ]
The RUN STORED-PROC statement sets up the execution of the stored-procedure, retrieves the result set(s), and loads it into the temp-table(s) provided you use the LOAD-RESULT-INTO function. The CLOSE STORED-PROC statement is automatically applied when the result set(s) is loaded into temp-tables because using temp-tables must consume all result sets of the procedure.