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.

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

objects exist in a data source. You can modify your data source to enable support <strong>for</strong><br />

these extended 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<br />

support the RECID/ROWID function. If non-<strong>OpenEdge</strong> applications are updating those<br />

data source tables, the applications must recognize the additional columns and update<br />

them appropriately. You can enable tables either through the use of triggers or through<br />

the use of computed columns. The use of computed columns is the preferred method<br />

as it offers greater efficiency and reliability, however it is only available when using MS<br />

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

supports arrays, and <strong>OpenEdge</strong> record identifiers. See the “ROWID function” section<br />

on page 110 <strong>for</strong> alternate 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<br />

your data source. To have access to this functionality, you must make changes to your<br />

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

an array column##1, column##2, etc. The columns must be adjacent and in<br />

sequence.<br />

2. Make sure that these columns are of the same data type and size. For example,<br />

if you want the schema holder to include an array named MONTH with 12 elements,<br />

the data source table must have 12 adjacent columns of the same data type<br />

named month##1, month##2, month##3, and so <strong>for</strong>th. <strong>OpenEdge</strong> names the<br />

corresponding field in the schema holder month. In your applications, refer to each<br />

element of the array as month[1], month[2], month[3], and so <strong>for</strong>th.<br />

3. If you have already created your schema holder, update it to reflect your changes<br />

to the 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<br />

associate with this function. Adding a new integer column named PROGRESS_RECID and<br />

defining it as a single-component index is the preferred method. This method can only<br />

be applied to a table that does not currently have an identity column defined. If your<br />

table already has an identity column, you can support ROWID by selecting an existing<br />

index. See the “Defining the ROWID” section on page 311 <strong>for</strong> instructions on selecting<br />

an existing index. The following procedure describes how to create the<br />

PROGRESS_RECID column to support ROWID. To use the ROWID function with a MS <strong>SQL</strong><br />

<strong>Server</strong> database, you must make changes to your data source table.<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> 313

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

Saved successfully!

Ooh no, something went wrong!