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.

Interfacing with RDBMS stored procedures<br />

Table 3–3 highlights additional language elements you can use with the stored procedure and<br />

the send-sql-statement language to use ROWID.<br />

Table 3–3: Returning result sets and loading the data into temp-tables<br />

Note: To optimize enhanced stored procedure calls, it is recommended that you use firehose<br />

cursor functionality. Use of firehose cursors provided through the connection pooling<br />

functionality supports the fastest way to read and return a result set. For details about<br />

connection pooling and firehose cursors, see the “Connection pooling” section on<br />

page 4–2.<br />

Creating a temp-table layout plan<br />

When using static or prepared dynamic temp-tables, you must define the temp-table layout in<br />

your application program to accommodate specific result sets be<strong>for</strong>e you attempt to populate<br />

the temp-tables with data. If a <strong>SQL</strong> statement retrieves more than one results set, you must<br />

define multiple temp-tables to be able to retrieve all the data. There<strong>for</strong>e, the success of this<br />

approach depends to a large extent on your:<br />

• Understanding of the specific data your <strong>for</strong>eign data source is providing you through a<br />

given stored procedure<br />

• Ability to correctly define temp-tables<br />

ABL Description<br />

RUN STORED–PROCEDURE statement Executes the stored procedure or send-sql-<br />

statement and tells <strong>OpenEdge</strong> that the<br />

stored procedure has ended.<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 either<br />

through a stored procedure or a send-sqlstatement<br />

to be put into one or more<br />

temp-tables. Static, unprepared dynamic,<br />

and prepared dynamic temp-tables are<br />

supported.<br />

Pass as many temp-tables as result set<br />

instances are returned by <strong>SQL</strong> statements<br />

in your Send-<strong>SQL</strong> or RUN STORED-PROC<br />

definition.<br />

Note: When using <strong>SQL</strong> statement(s)<br />

through a send-sql-statement or stored<br />

procedure to load result sets into<br />

temp-tables, RUN STORED-PROC carries an<br />

implicit RUN CLOSE-PROC statement. (The<br />

stored procedure’s output parameters are<br />

available after the RUN STORED-PROC<br />

executes and closes the procedure.)<br />

PROC-STATUS phrase Reads the return value (optional).<br />

3–23

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

Saved successfully!

Ooh no, something went wrong!