Try OpenEdge Now
skip to main content
DataServer for Microsoft SQL Server
RDBMS Stored Procedure Details : Data output and retrieval options : Loading results into a temp-table
 

Loading results into a temp-table

This technique allows you to:
*Specify one or more temp-table handle elements to retrieve stored procedure result sets and have the DataServer load the result set data directly into the associated temp-tables
*Have direct access to the fields defined in the temp-table
The temp-table approach maintains some separation between the data and the foreign data source which allows you to process the result sets quite independent of its database origin. Also, the result set definition is not contained within the schema holder.
Unless you pass unprepared dynamic temp-table handles into which the result sets are to be loaded, you still need to ensure that the temp-table record definition matches that of the stored procedures result set(s).
Passing empty temp-tables with the LOAD-RESULT-INTO phrase generates temp-table definitions dynamically based on a default mapping of data types. This method provides a data retrieval method completely independent of the foreign data source.
The LOAD-RESULT-INTO method represents a highly efficient means to transfer stored procedure result sets into temp-tables and provides significant performance gains over other techniques used to accomplish this same goal.
Note: The proc-text-buffer and the special native views techniques use the basic RUN STORED-PROC statement and are backward compatible to earlier versions of ABL. The LOAD-RESULT-INTO phrase provides a new technique to populate temp-tables directly in ABL.