Release 10.1A: OpenEdge Getting Started:
New and Revised Features

> ## Highlights of the LOAD-RESULT-INTO phrase

> In Release 10.1A, the `LOAD-RESULT-INTO` phrase provides a third, alternative technique to populate temp-tables directly in the 4GL using the `RUN STORED-PROC` statement. (In Release 10.1A, the `proc-text-buffer` and the native views techniques are maintained for backward compatibility to earlier versions of the Progress 4GL.) This new technique to load results from a foreign data source into a temp-table offers several enhancements over the previously noted techniques. Using `LOAD-RESULT-INTO`, you can:

> - 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-tables.

> - Employ a new adaptation of `ROWID` functionality, which in turn supports an alternative means to populate temp-tables of a ProDataSet Object.

> Figure 2–1 presents a code example in which the 4GL uses the `RUN STORED-PROC` statement with the `send-sql-statement` option. The `send-sql-statement` option allows native SQL to be passed as a parameter and executed like a stored procedure by the foreign data source.

>     RUN STORED-PROC send-sql-statement
>          (“SELECT name, address, city, state, postal_code FROM customer WHERE
>          credit_limit>=500”).

> Figure 2–1: RUN STORED-PROC statement with send-sql-statement example

> Native procedures stored by the foreign data source can also be executed from the `RUN STORED-PROC` statement by replacing the phrase `send-sql-statement` with the name that identifies the stored procedure in the foreign data source. If either approach produces a result set, the result set must then be handled by the 4GL before the procedure can be closed. Prior to the availability of the `LOAD-RESULT-INTO` option, the two older techniques, `proc-text-buffer` and native views, were available to process the results of a`RUN STORED-PROC`.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095