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.

Interfacing with RDBMS stored procedures<br />

Example 10 shows ABL procedure results of the previous stored procedure pcust as<br />

it is written into the new buffers pcust_orders and pcust_states.<br />

/* Results of the first two example code examples - Typed buffers */<br />

RUN STORED-PROC pcust (20, output 0, output 0).<br />

FOR EACH pcust_orders:<br />

DISPLAY pcust_orders.<br />

END.<br />

FOR EACH pcust_states:<br />

DISPLAY pcust_states.<br />

END.<br />

CLOSE STORED-PROC pcust.<br />

DISPLAY pcust.orders pcust.states.<br />

Example 10: Result set of pcust - typed buffers<br />

Because two different buffers have been defined, the returned values maintain their<br />

data types instead of being converted to character strings and stored in the<br />

<strong>OpenEdge</strong>-defined buffer proc–text–buffer. You can then use the returned values<br />

in calculations without first converting them back to their original data types. In addition,<br />

the two separate buffers make your output look cleaner, allowing ABL to build a new<br />

default frame <strong>for</strong> the two different types of output. Reading your results into an explicitly<br />

defined buffer also allows you to manipulate the data just as you would manipulate data<br />

from an <strong>OpenEdge</strong> database; <strong>for</strong> example, with Frame phrases and FORM statements.<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> 139

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

Saved successfully!

Ooh no, something went wrong!