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.

Chapter 3: RDBMS Stored Procedure Details<br />

Run Stored-Proc statement execution without the<br />

LOAD-RESULT-INTO phrase<br />

To implement most data retrieval options associated with a stored procedure,<br />

(excluding those that involve loading retrieved data into temp-tables) you must define<br />

the RUN STORED-PROC statement and explicitly end the stored procedure using the<br />

CLOSE STORED-PROC statement.<br />

You must define the RUN STORED-PROC and explicitly complete access to the stored<br />

procedure OUTPUT with the CLOSE STORED-PROC syntax expressions <strong>for</strong> a stored<br />

procedure implementation that retrieves the following types of data from the <strong>for</strong>eign<br />

data source:<br />

• proc-text-buffer<br />

• user-defined views<br />

For more in<strong>for</strong>mation about these data retrieval options, see the “<strong>Data</strong> output and<br />

retrieval options” section on page 132.<br />

Note: You can also implicitly or explicitly close a stored procedure to retrieve these<br />

types of data: return code or output parameters. For more in<strong>for</strong>mation about<br />

each of these data retrieval options, see the “<strong>Data</strong> output and retrieval options”<br />

section on page 132.<br />

The syntax details presented in this section describe how to run and close a stored<br />

procedure in the MS <strong>SQL</strong> <strong>Server</strong> data source.<br />

This is the syntax <strong>for</strong> the RUN STORED-PROC statement to execute an RDBMS stored<br />

procedure without the LOAD-RESULT-INTO phrase:<br />

Syntax<br />

RUN STORED-PROC procedure [ = PROC-HANDLE]<br />

[ NO-ERROR ]<br />

[([INPUT|OUTPUT|INPUT OUTPUT] [PARAM parameter-name =]expression, ...<br />

[INPUT|OUTPUT|INPUT OUTPUT] [PARAM parameter-name =]expression )]<br />

This type of syntax expression requires the explicit CLOSE STORED–PROC statement.<br />

This is the partial syntax <strong>for</strong> the CLOSE STORED–PROC statement:<br />

Syntax<br />

CLOSE STORED-PROC procedure<br />

[ integer-field = PROC-STATUS ]<br />

[ WHERE PROC-HANDLE = integer-field ]<br />

128 <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>

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

Saved successfully!

Ooh no, something went wrong!