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.

Chapter 2: Initial Programming Considerations<br />

r-code<br />

r-code is generated when an ABL procedure is compiled. The compiled r-code is<br />

portable across user interfaces. For example, r-code that you compile on Sun Solaris<br />

can run on any other UNIX system (character user interface).<br />

r-code is not portable across Window systems; that is, r-code compiled <strong>for</strong> a character<br />

application will not run on Windows and r-code compiled <strong>for</strong> Windows will not run on a<br />

character user interface.<br />

r-code is also not portable among database management systems. ABL generates<br />

calls that are specific to a database. For example:<br />

• Code that you compile <strong>for</strong> a database named sports will not run with a database<br />

named mysports.<br />

• Code that you compile <strong>for</strong> MS <strong>SQL</strong> <strong>Server</strong> will not run on an <strong>OpenEdge</strong> database.<br />

Prior to <strong>OpenEdge</strong> Version 11, r-code stored the physical position of a database<br />

column. r-code was not compatible with the server schema if the position of a column<br />

changed on the server. In Version 11, r-code stores a logical identifier <strong>for</strong> the physical<br />

position of a database column. There<strong>for</strong>e, in <strong>OpenEdge</strong> 11, column positions in the<br />

server table can be rearranged without the need to recompile.<br />

See <strong>OpenEdge</strong> Deployment: Managing ABL Applications <strong>for</strong> more details on r-code<br />

portability.<br />

The size of r-code grows significantly when you compile procedures against a MS <strong>SQL</strong><br />

<strong>Server</strong> data source as compared to compiling against an <strong>OpenEdge</strong> database. The<br />

r-code <strong>for</strong> a <strong>Data</strong><strong>Server</strong> application contains as text portions of <strong>SQL</strong> statements that<br />

the <strong>Data</strong><strong>Server</strong> passes to the data source.<br />

FOR statements<br />

FOR FIRST and FOR LAST statements that cause the <strong>Data</strong><strong>Server</strong> to sort data be<strong>for</strong>e<br />

returning it to the client behave differently when returning data from a MS <strong>SQL</strong> <strong>Server</strong><br />

data source than when returning data from an <strong>OpenEdge</strong> database. The data source<br />

might not sort data like the <strong>OpenEdge</strong> database does, so the order in which records<br />

return might differ. In addition, the server-side result set is limited to a single record to<br />

improve per<strong>for</strong>mance.<br />

Features and language differences<br />

The <strong>Data</strong><strong>Server</strong> supplies you with complete ABL functionality when accessing MS <strong>SQL</strong><br />

<strong>Server</strong> data sources. Many ABL language elements (statements, functions, and so<br />

<strong>for</strong>th) and <strong>Data</strong> Dictionary features work the same whether your application accesses<br />

a data source through the <strong>Data</strong><strong>Server</strong> or an <strong>OpenEdge</strong> database.<br />

Use the DBRESTRICTIONS function to find out which <strong>OpenEdge</strong> features your MS <strong>SQL</strong><br />

<strong>Server</strong> data source does not support. For the <strong>Data</strong><strong>Server</strong> <strong>for</strong> MS <strong>SQL</strong> <strong>Server</strong>,<br />

DBRESTRICTIONS can return SETUSERID and COUNT–OF. In certain circumstances, it can<br />

return additional values. For example, it can return READ–ONLY if you connect to the<br />

schema holder in read-only mode. See the “DBRESTRICTIONS function” reference<br />

entry in <strong>OpenEdge</strong> Development: ABL Reference <strong>for</strong> in<strong>for</strong>mation on syntax.<br />

116 <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>

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

Saved successfully!

Ooh no, something went wrong!