13.01.2013 Views

OpenEdge Data Management: DataServer for Microsoft SQL Server

OpenEdge Data Management: DataServer for Microsoft SQL Server

OpenEdge Data Management: DataServer for Microsoft SQL Server

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

RDBMS stored procedure basics<br />

RDBMS stored procedure basics<br />

In the <strong>OpenEdge</strong> environment, you can think of a stored procedure definition as having<br />

two basic, interrelated parts:<br />

• Execution controls to run and close a store procedure — Comprises the<br />

in<strong>for</strong>mation needed to execute a stored procedure request against the MS S data<br />

source. At a minimum, all stored procedures discussed in this guide are<br />

assessable using the RUN STORED-PROCEDURE statement.<br />

• Language elements that enable access to specific data results — Qualifies<br />

the retrieved data, or result sets, that the stored procedure’s execution returns.<br />

Various keywords, phrases, statements, and syntax elements support different<br />

retrieval options <strong>for</strong> stored procedure output. This part of the stored procedure<br />

implementation reflects your analysis of your data needs; based on this analysis,<br />

you determine the additional syntax elements you need to define the output<br />

elements and data results you want retrieved.<br />

Table 20 identifies and briefly introduces the elements that comprise a stored<br />

procedure definition; each of these elements is also more fully discussed later in this<br />

chapter.<br />

Table 20: Stored procedure language elements<br />

ABL language element Description<br />

RUN STORED–PROCEDURE statement Executes a stored procedure<br />

PROC–HANDLE phrase Allows you to specify a handle to<br />

identify a stored procedure<br />

PROC–STATUS phrase Reads the return value<br />

LOAD-RESULT-INTO phrase Allows data from a result set that is<br />

returned <strong>for</strong> a <strong>for</strong>eign data source to be<br />

put into one or more temp-tables<br />

PARAM phrase Identifies run-time parameters to be<br />

passed to and/or from the stored<br />

procedure<br />

CLOSE STORED–PROCEDURE statement Enables the values to be retrieved<br />

from the output parameters that you<br />

defined <strong>for</strong> the stored procedure,<br />

finalizes result sets data processing,<br />

and tells <strong>OpenEdge</strong> that the stored<br />

procedure has ended<br />

Note: You can substitute the abbreviations RUN STORED–PROC and CLOSE<br />

STORED–PROC <strong>for</strong> the full names RUN STORED–PROCEDURE and CLOSE<br />

STORED–PROCEDURE, respectively. The remainder of this guide generally uses<br />

the abbreviated <strong>for</strong>m.<br />

See the “Run Stored-Procedure details” section on page 124 <strong>for</strong> more details about the<br />

reference entries presented in Table 20.<br />

<strong>OpenEdge</strong> <strong>Data</strong> <strong>Management</strong>: <strong>Data</strong><strong>Server</strong> <strong>for</strong> <strong>Microsoft</strong> <strong>SQL</strong> <strong>Server</strong> 121

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!