Examples based on views created in the data source
- Last Updated: January 17, 2024
- 2 minute read
- OpenEdge
- Version 12.8
- Documentation
Syntax
The examples in this section do not use the
supplied proc-text-buffer buffer. Instead, they
show how to define formatted buffers by creating views in the data
source, using the following syntax:
|
The following two examples show the views created
in your Oracle data source that you can use as buffers to store
the results from the stored procedure pcust:
|
|
Running the send-sql-statement option twice
This example runs thesend-sql-statement option twice; procedure handles (through the
PROC-HANDLE function) identify the different results from the Oracle
database.
|
If you use more than one send-sql-statement at a time to send
SELECT statements, you must explicitly define procedure handles for
each.
A stored procedure returning multiple result sets and how to access the result sets using cursor arguments and buffers
The following example is a two-part example. The code in the first part shows a stored procedure. The code in the second part shows the ABL procedure that is associated with the stored procedure.
|
The ABL procedure code in this example assumes that the pcust_buffer and
porder_buffer exist in the schema and that they match the result-sets
schema.
|
As the above example shows, the stored procedure pcustorder returns
multiple result-sets. The second code box shows the procedure used to access the result
sets; it uses cursor arguments and buffers.
Because two different buffers have been defined, the returned values maintain their data
types instead of being converted to character strings and stored in an ABL-defined buffer
proc-text-buffer. You can then use the returned values in calculations
without first converting them back to their original data types. In addition, the two
separate buffers make your output look cleaner, allowing ABL to build a new default frame
for the two different types of output. Reading your results into an explicitly defined
buffer also allows you to manipulate the data just as you would manipulate data from an
OpenEdge database; for example, with Frame phrases and FORM statements.