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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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 two<br />

basic, interrelated parts:<br />

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

needed to execute a stored procedure request against the MS S data source. At a minimum,<br />

all stored procedures discussed in this guide are assessable using the RUN<br />

STORED-PROCEDURE statement.<br />

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

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

phrases, statements, and syntax elements support different retrieval options <strong>for</strong> stored<br />

procedure output. This part of the stored procedure implementation reflects your analysis<br />

of your data needs; based on this analysis, you determine the additional syntax elements<br />

you need to define the output elements and data results you want retrieved.<br />

Table 3–1 identifies and briefly introduces the elements that comprise a stored procedure<br />

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

Table 3–1: 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 identify<br />

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 put<br />

into one or more temp-tables<br />

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

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

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

output parameters that you defined <strong>for</strong> the<br />

stored procedure, finalizes result sets data<br />

processing, and tells <strong>OpenEdge</strong> that the<br />

stored procedure has ended<br />

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

full names RUN STORED–PROCEDURE and CLOSE STORED–PROCEDURE, respectively. The<br />

remainder of this guide generally uses the abbreviated <strong>for</strong>m.<br />

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

entries presented in Table 3–1.<br />

3–3

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

Saved successfully!

Ooh no, something went wrong!