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.

find.p<br />

/* This code accesses an <strong>OpenEdge</strong> database. */<br />

FIND demo.customer WHERE demo.customer.custnum EQ 3.<br />

FIND PREV demo.customer.<br />

DISPLAY demo.customer.custnum<br />

LABEL "PROGRESS DATABASE RESULT" WITH FRAME new-frame.<br />

/* This code accesses a MS <strong>SQL</strong> <strong>Server</strong> data source.*/<br />

FIND mssdemo.customer WHERE mssdemo.customer.custnum EQ 3.<br />

FIND PREV mssdemo.customer.<br />

DISPLAY mssdemo.customer.custnum<br />

LABEL "MSS DATA SOURCE RESULT" WITH COL 29.<br />

ABL issues<br />

When you run find.p with an <strong>OpenEdge</strong> table and a MS <strong>SQL</strong> <strong>Server</strong> table, you get<br />

the following results (assuming that the database has records <strong>for</strong> customer numbers 1<br />

through 4):<br />

OPENEDGE DATABASE RESULT<br />

If the FIND PREV statement fails, the cursor remains located after customer.custnum 3<br />

in the <strong>OpenEdge</strong> table, which was the last record scanned. In the data source table,<br />

the cursor is positioned at custnum 2. Failed finds do not affect cursor position in data<br />

source tables.<br />

Compiling <strong>OpenEdge</strong> procedures<br />

The COMPILE statement lets you compile ABL procedures and save the compilations to<br />

disk. This speeds up your application execution time since the application does not<br />

have to recompile it every time you want to run a procedure.<br />

To compile procedures that access a MS <strong>SQL</strong> <strong>Server</strong> data source, start up an<br />

<strong>OpenEdge</strong> session and connect to the schema holder using the schema holder’s<br />

logical database name, then use the COMPILE statement. If you change the name of the<br />

schema holder after you compile a procedure, you must connect to the renamed<br />

schema holder and recompile the procedure. For more in<strong>for</strong>mation, see the “COMPILE<br />

Statement” reference entry in <strong>OpenEdge</strong> Development: ABL Reference.<br />

Note: You do not have to connect to the MS <strong>SQL</strong> <strong>Server</strong> database to compile a<br />

procedure. The schema holder contains all the in<strong>for</strong>mation that the compiler<br />

requires.<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> 115<br />

2<br />

MSS DATA SOURCE<br />

RESULT<br />

2

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

Saved successfully!

Ooh no, something went wrong!