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.

RDBMS Stored Procedure Details<br />

3–36<br />

FIELD tRecid AS ROWID /* must be changed to ROWID type */<br />

FIELD tRECID_ident AS INTEGER.<br />

If the table uses computed-column PROGRESS_RECID option, then ttCustomer<br />

temp-table definition should be:<br />

DEFINE TEMP-TABLE ttCustomer LIKE Sports.Customer<br />

FIELD tRecid AS ROWID /* Must be changed to ROWID type */<br />

FIELD tRECID_ident AS INT64<br />

FIELD tRECID_alt as INT64.<br />

• The TEMP-TABLE must be defined to the Pro<strong>Data</strong>Set. The following line excerpted from<br />

Example 3–26 shows this definition:<br />

DEFINE DATASET dsCustomer FOR ttCustomer.<br />

• The technique, demonstrated in Example 3–26, does not change the default behavior of<br />

the ROWID function, but provides a mechanism <strong>for</strong> the ROWID value to be stored along side<br />

its corresponding result rows; there<strong>for</strong>e, using the ROWID value to access database rows is<br />

unconventional with respect to the normal, or more typical, association between ROWID and<br />

a database table row. The following code demonstrates this difference.<br />

Default use of ROWID function on a record buffer, as excerpted from Example 3–26:<br />

FIND FIRST Customer WHERE Customer.CustNum = 1 NO-LOCK.<br />

rid-1 = ROWID(Customer).<br />

In contrast, the following code excerpt from Example 3–26, demonstrates an alternative<br />

use of the ROWID value with a temp-table:<br />

FIND FIRST Customer WHERE Customer.CustNum = 1 NO-LOCK.<br />

rid-2 = ttCustomer.tRecid.<br />

Additional Pro<strong>Data</strong>Set support<br />

As previously demonstrated in Example 3–26, the LOAD-RESULT-INTO functionality provides a<br />

very fast and efficient way to populate the temp-table(s) of a Pro<strong>Data</strong>Set Object.<br />

Example 3–27, a two-part example, builds on the techniques demonstrated in Example 3–26,<br />

but shows the Pro<strong>Data</strong>Set object BEFORE-FILL procedure can be modified to provide a single<br />

Pro<strong>Data</strong>Set data access object that can be used against native <strong>OpenEdge</strong> or against MS <strong>SQL</strong><br />

<strong>Server</strong> and other <strong>Data</strong><strong>Server</strong> data sources.

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

Saved successfully!

Ooh no, something went wrong!