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.

ROWID Support<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<br />

from Example 26 shows this definition:<br />

DEFINE DATASET dsCustomer FOR ttCustomer.<br />

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

behavior of the ROWID function, but provides a mechanism <strong>for</strong> the ROWID value to<br />

be stored along side its corresponding result rows; there<strong>for</strong>e, using the ROWID<br />

value to access database rows is unconventional with respect to the normal, or<br />

more typical, association between ROWID and a database table row. The following<br />

code demonstrates this difference.<br />

Default use of ROWID function on a record buffer, as excerpted from Example 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 26, demonstrates an<br />

alternative 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 26, the LOAD-RESULT-INTO functionality<br />

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

Object.<br />

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

Example 26, but shows the Pro<strong>Data</strong>Set object BEFORE-FILL procedure can be<br />

modified to provide a single Pro<strong>Data</strong>Set data access object that can be used against<br />

native <strong>OpenEdge</strong> or against MS <strong>SQL</strong> <strong>Server</strong> and other <strong>Data</strong><strong>Server</strong> data sources.<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> 157

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

Saved successfully!

Ooh no, something went wrong!