29.06.2013 Views

NATURAL PROCESS Extends NATURAL to Operations Center

NATURAL PROCESS Extends NATURAL to Operations Center

NATURAL PROCESS Extends NATURAL to Operations Center

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.

keeps track of positionality in the<br />

set of records. As each member of<br />

the set is FETCH'ed, the cursor advances<br />

<strong>to</strong> the next member of the<br />

set. The "CURRENT OF cursor"<br />

syntax allows one <strong>to</strong> refer <strong>to</strong> the<br />

~urrent record of the set.<br />

A cursor is defined with the<br />

DECLARE statement. In ADABAS<br />

SQL, the cursor name becomes the<br />

ADABAS command ID unless you<br />

are using the global DYNAMCID.<br />

Cursor Commands<br />

OPEN<br />

The OPEN of the cursor activates<br />

the cursor and positions it at<br />

the beginning of the set of<br />

selected records. In ADABAS<br />

SQL, the OPEN also initializes<br />

ADABAS variables. It should<br />

never be assumed that this<br />

command makes any data<br />

available <strong>to</strong> you.<br />

FETCH<br />

The FETCH of a cursor retrieves<br />

data in<strong>to</strong> user variables and<br />

advances the cursor <strong>to</strong> the next<br />

record in the set. In ADABAS<br />

SQL, the data is returned <strong>to</strong> the<br />

ADABAS record buffer. All<br />

record processing logic should<br />

be built around the first<br />

FETCH.<br />

CLOSE<br />

The CLOSE statement deactivates<br />

the cursor. It releases the rec-<br />

ords and any resources at-<br />

tached <strong>to</strong> the cursor. It should<br />

be executed after the last<br />

FETCH in the processing loop.<br />

In ADABAS SQL the CLOSE<br />

generates an ADABAS RC<br />

command.<br />

After a CLOSE of a cursor, the<br />

original SELECT statement<br />

may be used again with the<br />

same cursor name and different<br />

selection criteria <strong>to</strong> select a-dif-<br />

ferent set of records. .<br />

Single Record Processing in -<br />

ADABAS SQL<br />

In single record the<br />

SELECT statement is executable<br />

and there is no need for cursor<br />

commands. You may still declare a<br />

cursor if you want <strong>to</strong> be able <strong>to</strong><br />

refer back <strong>to</strong> the statement using<br />

"CURRENT OF cursor" syntax. You<br />

may sometimes want <strong>to</strong> declare a<br />

cursor <strong>to</strong> force a non-blank -<br />

ADABAS command ID.<br />

This article has been intended as a<br />

follow-up article <strong>to</strong> the one that ap-<br />

peared in the August issue entitled<br />

"Converting Existing ADAMINT<br />

Programs <strong>to</strong> ADASQL." It is my<br />

hope that the reader will now have<br />

a clearer understanding of<br />

ADABAS SQL cursors. . .<br />

OVERVIEW OF SQL APPROACH<br />

TO RECORD RETRIEVAL<br />

Record Selection:<br />

SELECT Statement: ~e~uest a record or a set of<br />

, records that meet given - -- -<br />

- search criteria.<br />

Cursor: Mechanism <strong>to</strong> keep track of a set of<br />

records that are selected. - - -<br />

Cursor Commands:<br />

OPEN: Activate the cursor; position at beginning<br />

of set.<br />

FETCH: Advance the cursor <strong>to</strong> the next record in<br />

the set; retrieve data in<strong>to</strong> user variables.<br />

CLOSE: Deactivate the cursor; will no longer be<br />

associated with the set of records that<br />

were selected.<br />

. -<br />

Communication. .<br />

Products: User's- . a -<br />

Update<br />

Ellen M. Birch<br />

Prlce Waterhouse<br />

This is the first of a regular series of . ., -<br />

articles I will be writing <strong>to</strong> foster information<br />

exchange among users of<br />

the Software AG communications<br />

products. First, I want <strong>to</strong> thank you<br />

all for giving me this opportunity <strong>to</strong><br />

represent you and your concerns <strong>to</strong><br />

Software AG and the Executive<br />

Committee as the COM-PLETE<br />

Product Representative. I was very<br />

honored by your selection of me,<br />

and hope I will fulfill your expectations.<br />

I also want <strong>to</strong> thank Ron<br />

Hoover for the excellent job he has<br />

done in this position. I was very<br />

encouraged <strong>to</strong> see so many of you - .<br />

at the conference-it was a good<br />

representation of the communications<br />

user community.<br />

I also want <strong>to</strong> make a request of all<br />

of you-that you think of me as<br />

your voice <strong>to</strong> Software AG and - - -<br />

other users. Please call or write me<br />

(a note on a postcard would be just<br />

fine) if you have concerns or infor-<br />

mation <strong>to</strong> pass on or if you're look-<br />

ing for other users with similar<br />

problems or environments. I will be<br />

passing on these questions, tips, or<br />

information in this column. Please<br />

let me know if you are interested in<br />

any of the current SIGs (Perfor-<br />

mance and Tuning, Technical Sup-<br />

port, and COM-PLETE Tools) or if<br />

you are interested in starting any<br />

other SIGs. We are especially look-<br />

ing at the level of interest in the - -<br />

Technical Support SIG, which re-<br />

cently lost its chairman, Jim Lee.<br />

I want <strong>to</strong> urge all of you <strong>to</strong> become<br />

more involved with SAGGROUP-<br />

it can only help you with the qual-<br />

ity of your Software AG products<br />

and with how effectively you're<br />

using them. Please call or write <strong>to</strong> --<br />

me (my phone number and address<br />

are listed in the back of this issue),<br />

even just <strong>to</strong> chat about what you're<br />

doing. I'm looking forward <strong>to</strong> hear-<br />

ing from you!<br />

- -

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

Saved successfully!

Ooh no, something went wrong!