Try OpenEdge Now
skip to main content
DataServer for Oracle
RDBMS Stored Procedure Details : Interfacing with RDBMS stored procedures : Defining a view to use as a buffer : Technique to define a view to use as a buffer
 
Technique to define a view to use as a buffer
While a stored procedure can include multiple SQL statements, a buffer that you define contains the format of only a single result set. You need to define multiple views to accommodate multiple result sets.
To define a buffer:
1. Define a view in the Oracle data source with the following characteristics:
*The naming convention BUFFER_buffername
*The same number of columns and data types that the stored procedure returns in the result set
*The columns in the order that the stored procedure returns them
For example, to return two columns with two types of values, an integer and a character string, use an SQL utility to define the following view in the data source:
CREATE VIEW BUFFER_custlist AS SELECT customer.custnum,
  customer.name FROM customer WHERE 1 = 0
Notice that these views are defined to ensure that they never return any results. This helps to indicate that the purpose of the view is its buffer content and not its SQL capabilities. It is not necessary to define views that you will use as buffers this way, but it does allow you to distinguish quickly between views and buffers.
2. Update your schema image using the Update/Add Table Definitions DataServer utility. The utility adds the view to the list of accessible objects in the schema holder. The DataServer defines the view as a buffer that ABL can use. See Updating a schema image for instructions on using this utility.