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

Example 21 shows the use of a PROC-STATUS phrase. The PROC-STATUS phrase must<br />

be defined as part of the RUN-STORED-PROC statement because of the implicit CLOSE<br />

STORED-PROC that is associated with the LOAD-RESULT-INTO phrase.<br />

/* Sixth example - Example of the implicit close stored-proc and use of<br />

LOAD-RESULT-INTO */<br />

DEFINE VARIABLE iStat AS INTEGER NO-UNDO.<br />

DEFINE VARIABLE ttHandle AS HANDLE NO-UNDO.<br />

CREATE TEMP-TABLE ttHandle.<br />

RUN STORED-PROCEDURE pcust LOAD-RESULT-INTO ttHandle<br />

iStat = PROC-STATUS (20, output 0, output 0).<br />

DISPLAY iStat.<br />

Example 21: Use of a PROC-STATUS phrase<br />

In Example 21, note that the PROC-STATUS phrase does not need a PROC-HANDLE<br />

phrase because it is retrieved using the RUN STORED-PROC statement and not after this<br />

statement’s execution as it typically is used.<br />

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