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.

Initial Programming Considerations<br />

ABL issues<br />

2–52<br />

The following sections describe how to use various ABL statements in <strong>Data</strong><strong>Server</strong> applications<br />

and list which ABL statements and functions the <strong>Data</strong><strong>Server</strong> does not support.<br />

ROWID function<br />

The ROWID data type provides a unique record identifier that is compatible across <strong>OpenEdge</strong> and<br />

MS <strong>SQL</strong> <strong>Server</strong> databases. Applications that use the ROWID function behave in the same way<br />

whether they access records in an <strong>OpenEdge</strong> databases or in a MS <strong>SQL</strong> <strong>Server</strong> data source. The<br />

ROWID function is more consistent than RECID across data sources, since RECID cannot guarantee<br />

uniqueness. Progress Software Corporation recommends that you replace the RECID function<br />

with ROWID in existing applications.<br />

The <strong>Data</strong><strong>Server</strong> supports the ROWID function <strong>for</strong> MS <strong>SQL</strong> <strong>Server</strong> data source tables that have a<br />

unique index. The <strong>Data</strong><strong>Server</strong> utilities use an index that meets this criterion to provide values<br />

<strong>for</strong> the ROWID function. If you build your schema holder using the <strong>OpenEdge</strong> DB to MS <strong>SQL</strong><br />

<strong>Server</strong> utility and you select the Create RECID field option, it is automatically designated as<br />

the ROWID index. However, if you do not create the RECID field, you can select a unique index<br />

to support ROWID. See the “Defining the ROWID” section on page 7–35 <strong>for</strong> instructions.<br />

Note: Starting with <strong>OpenEdge</strong> Release 10.1B, the default external representation of ROWID<br />

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

an integer value to define ROWID is not required, but rather an option to efficiently<br />

represent ROWID as a numeric binary value. The MS <strong>SQL</strong> <strong>Server</strong> <strong>Data</strong><strong>Server</strong> supports<br />

the INT64 data type to emulate ROWID expansion support in this use.<br />

The ROWID value in a MS <strong>SQL</strong> <strong>Server</strong> data source differs from the ROWID value in an <strong>OpenEdge</strong><br />

database if you use the unique index method in the following ways:<br />

• In an <strong>OpenEdge</strong> database, you can create a ROWID without creating a record. In <strong>Data</strong><strong>Server</strong><br />

applications, creating a ROWID creates a record. The following statement illustrates the<br />

difference in behavior:<br />

CREATE customer.<br />

a = ROWID(customer).<br />

The <strong>Data</strong><strong>Server</strong> creates a customer record using default values.<br />

• The ROWID changes if the value of the unique keys in the designated index changes.<br />

• The <strong>Data</strong><strong>Server</strong> considers a single instance of the Unknown value (?) to be unique, so it is<br />

possible to have a ROWID with the Unknown value (?). However, the <strong>OpenEdge</strong> ROWID<br />

function fails if you search <strong>for</strong> an Unknown value (?), because an <strong>OpenEdge</strong> ROWID will<br />

never have the Unknown value (?). For example, the following FIND statement fails even<br />

if there is a row with the Unknown value (?) in the designated column:<br />

FIND customer WHERE ROWID(customer) EQ ?.

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

Saved successfully!

Ooh no, something went wrong!