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.

ROWID Support<br />

It is important to note that the unique index key used to derive the Progress ROWID must be a<br />

single component index <strong>for</strong> it to map to the ROWID of a temp-table as described in the following<br />

discussion. For more details, see the ROWID function discussion in Chapter 2, “Initial<br />

Programming Considerations.”<br />

Starting in <strong>OpenEdge</strong> Release 10.1B, the default external representation of ROWID enables the<br />

MS <strong>SQL</strong> <strong>Server</strong> <strong>Data</strong><strong>Server</strong> to use a 64-bit integer value <strong>for</strong> ROWID.<br />

Also, be<strong>for</strong>e discussing ROWID as it relates to the RUN STORED-PROC statement, it is important to<br />

understand an important property of the <strong>OpenEdge</strong> ROWID. The “ROWID—Standard ABL<br />

behavior” section on page 3–33 presents this in<strong>for</strong>mation.<br />

ROWID—Standard ABL behavior<br />

The ROWID value of a temp-table buffer will be different than the ROWID value of a record<br />

BUFFER even if the underlying data is identical. This difference exists because the ROWID<br />

function relies on the record buffer name. Example 3–24 shows the standard, expected ABL<br />

behavior.<br />

DEFINE VARIABLE rid-1 AS ROWID NO-UNDO.<br />

DEFINE VARIABLE rid-2 AS ROWID NO-UNDO.<br />

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

t<br />

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

FIELD tRecid AS INTEGER<br />

FIELD tRECID_ident AS INTEGER.<br />

ttHandle[1] = TEMP-TABLE ttCustomer:HANDLE.<br />

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

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

RUN STORED-PROC send-sql-statement<br />

LOAD-RESULT-INTO ttHandle (“select * from customer where custnum = 1”).<br />

rid-2 = ROWID(ttCustomer).<br />

IF rid-1 NE rid-2 THEN<br />

MESSAGE “The same record but different ROWID’s”.<br />

Example 3–24: Expected ABL behavior—ROWID value of a temp-table buffer<br />

The following sections illustrate the differences between the ROWID value of a temp-table buffer<br />

and the ROWID value of a record BUFFER so that you can best understand, program <strong>for</strong>, and<br />

leverage the use of the ROWID function with the LOAD-RESULT-INTO clause of the RUN<br />

STORED-PROCEDURE command.<br />

3–33

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

Saved successfully!

Ooh no, something went wrong!