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.

Chapter 3: RDBMS Stored Procedure Details<br />

The following types of temp-tables can support result sets:<br />

• Static — A temp-table whose schema is defined at compile time.<br />

• Dynamic — A temp-table whose schema is defined at run time. There are two<br />

types of dynamic temp-tables: dynamic-prepared and dynamic-unprepared.<br />

For additional details about using the LOAD-RESULT-INTO phrase with the temp-table<br />

handle, see the “Loading result sets into temp-tables” section on page 141.<br />

PROC-STATUS phrase<br />

The PROC-STATUS phase returns the return status from a MS <strong>SQL</strong> <strong>Server</strong> stored<br />

procedure. The return status is an integer value that typically indicates whether a<br />

stored procedure succeeded or failed; if a stored procedure fails, a code indicates why<br />

it failed. See your <strong>Microsoft</strong> <strong>SQL</strong> <strong>Server</strong> documentation <strong>for</strong> descriptions of the possible<br />

values <strong>for</strong> the return status.<br />

PROC-HANDLE phrase<br />

The PROC-HANDLE phrase allows you to specify a handle to act as a unique identifier <strong>for</strong><br />

a MS <strong>SQL</strong> <strong>Data</strong><strong>Server</strong> stored procedure. For example, the PROC-HANDLE assigns a<br />

value to the specified integer field or variable (integer–field) that uniquely identifies<br />

the stored procedure that is returning results from MS <strong>SQL</strong> <strong>Server</strong>.<br />

Note these additional points about the PROC-HANDLE:<br />

• Progress Software Corporation recommends that you specify a procedure handle<br />

<strong>for</strong> each stored procedure that you run.<br />

• You do not have to specify a handle if there is only one active stored procedure<br />

and you do not include <strong>SQL</strong> statements in the <strong>OpenEdge</strong> application.<br />

NO-ERROR option<br />

The NO-ERROR option specifies that any ERROR condition that the RUN<br />

STORED–PROCEDURE statement produces is suppressed. Be<strong>for</strong>e you close a stored<br />

procedure, check the ERROR–STATUS handle <strong>for</strong> in<strong>for</strong>mation on any errors that<br />

occurred. You receive an error when you attempt to close a stored procedure that did<br />

not start.<br />

Note: This option must appear be<strong>for</strong>e any runtime parameter list.<br />

PARAM phrase<br />

The Param phrase identifies a run-time parameter to be passed to the stored<br />

procedure. A parameter has the following syntax:<br />

Syntax<br />

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

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

126 <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!