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

When you run stored procedures concurrently, the <strong>Data</strong><strong>Server</strong> uses one connection to<br />

the data source per procedure. If different stored procedures attempt to update the<br />

same record from a single client’s requests, the connections could block each other or<br />

a deadlock might occur.<br />

Notes: You must define a PROC-HANDLE phrase <strong>for</strong> each stored procedure phrase that<br />

is simultaneously active. This technique provides a CLOSE STORED-PROC<br />

statement that can identify the targeted open procedure and close it.<br />

In contrast, since a stored procedure executed with the LOAD-RESULT-INTO<br />

phrase implicitly closes the procedure once the execution ends and the data<br />

retrieved is placed into temp tables, it essentially runs serially and has no use<br />

<strong>for</strong> a PROC-HANDLE.<br />

• When you create or update your schema image, the stored procedures appear in<br />

the list of accessible objects along with tables, view, and sequences. <strong>OpenEdge</strong><br />

allows you to run the stored procedures that you create in data sources using the<br />

procedure definitions in your schema image. See your <strong>Microsoft</strong> <strong>SQL</strong> <strong>Server</strong><br />

documentation <strong>for</strong> complete in<strong>for</strong>mation about creating and using stored<br />

procedures.<br />

• If the ABL that executes a stored procedure is already within a transaction block,<br />

the stored procedure becomes an extension of that transaction and will not<br />

commit to the database until the ABL transaction is completed. However, because<br />

the stored procedure does not execute as part of ABL client process, it cannot be<br />

rolled back by ABL.<br />

• The <strong>Data</strong><strong>Server</strong> cannot roll back sub-transactions in the stored-procedure context<br />

since it has no control over what the stored procedure executes.<br />

The following section expands on the use of the RUN STORED-PROC statement.<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> 123

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

Saved successfully!

Ooh no, something went wrong!