OpenEdge Data Management: DataServer for Microsoft SQL Server
OpenEdge Data Management: DataServer for Microsoft SQL Server
OpenEdge Data Management: DataServer for Microsoft SQL Server
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Adding extended ABL support<br />
Adding extended ABL support<br />
The <strong>Data</strong><strong>Server</strong> provides support <strong>for</strong> arrays and the RECID/ROWID function when certain objects<br />
exist in a data source. You can modify your data source to enable support <strong>for</strong> these extended<br />
features. You can also add support when you create new tables.<br />
The <strong>Data</strong><strong>Server</strong> maintains the columns that you add to your data source tables to support the<br />
RECID/ROWID function. If non-<strong>OpenEdge</strong> applications are updating those data source tables, the<br />
applications must recognize the additional columns and update them appropriately. You can<br />
enable tables either through the use of triggers or through the use of computed columns. The use<br />
of computed columns is the preferred method as it offers greater efficiency and reliability,<br />
however it is only available when using MS <strong>SQL</strong> <strong>Server</strong> 2005 or later versions.<br />
The following sections describe how to modify an existing data source so that it supports arrays,<br />
and <strong>OpenEdge</strong> record identifiers. See the “ROWID function” section on page 2–52 <strong>for</strong> alternate<br />
ways to support this function.<br />
Modifying tables to support arrays<br />
The <strong>Data</strong><strong>Server</strong> allows you to extend <strong>OpenEdge</strong>’s ability to support database arrays to your data<br />
source. To have access to this functionality, you must make changes to your data source table.<br />
To modify a table to support arrays:<br />
1. Name the columns of a data source table that you want the <strong>Data</strong><strong>Server</strong> to roll into an array<br />
column##1, column##2, etc. The columns must be adjacent and in sequence.<br />
2. Make sure that these columns are of the same data type and size. For example, if you want<br />
the schema holder to include an array named MONTH with 12 elements, the data source table<br />
must have 12 adjacent columns of the same data type named month##1, month##2,<br />
month##3, and so <strong>for</strong>th. <strong>OpenEdge</strong> names the corresponding field in the schema holder<br />
month. In your applications, refer to each element of the array as month[1], month[2],<br />
month[3], and so <strong>for</strong>th.<br />
3. If you have already created your schema holder, update it to reflect your changes to the<br />
data source table.<br />
Using triggers to enable PROGRESS_RECID support of<br />
the ROWID function<br />
If you want to use the ROWID function with a data source, you must select an index to associate<br />
with this function. Adding a new integer column named PROGRESS_RECID and defining it as a<br />
single-component index is the preferred method. This method can only be applied to a table that<br />
does not currently have an identity column defined. If your table already has an identity column,<br />
you can support ROWID by selecting an existing index. See the “Defining the ROWID” section<br />
on page 7–35 <strong>for</strong> instructions on selecting an existing index. The following procedure describes<br />
how to create the PROGRESS_RECID column to support ROWID. To use the ROWID function with a<br />
MS <strong>SQL</strong> <strong>Server</strong> database, you must make changes to your data source table.<br />
Note: Starting in <strong>OpenEdge</strong> Release 10.1B, the default PROGRESS_RECID recognizes an INT64<br />
value <strong>for</strong> a MS <strong>SQL</strong> <strong>Server</strong> <strong>Data</strong><strong>Server</strong>. The unique key value in the PROGRESS_RECID<br />
7–37