View previous topic :: View next topic
|
Author |
Message |
soumak
New User
Joined: 08 Sep 2005 Posts: 1
|
|
|
|
Hi,
Can someone please explain the difference between READ and FIND in Natural?
It would be helpful if I could get some examples to show the difference. |
|
Back to top |
|
 |
agra2jain
New User
Joined: 06 Sep 2005 Posts: 1
|
|
|
|
Read - Reads the records from a database; in physical sequence, ADABAS ISN sequence, or
in value sequence of descriptor (key) field. Initiate a processing loop.
Example:-
1. READ EMPLOY-VIEW IN PHYSICAL SEQUENCE
DISPLAY PERSONNEL-ID NAME *ISN *COUNTER
END-READ
2. READ EMPLOY-VIEW BY ISN
STARTING FROM 1 ENDING AT 3
DISPLAY PERSONNEL-ID NAME *ISN *COUNTER
END-READ
3. READ EMPLOY-VIEW IN VARIABLE #DIRECTION SEQUENCE BY NAME
DISPLAY PERSONNEL-ID NAME *ISN *COUNTER
END-READ
=============================================
Find - Selects records from a database file based on user-specified criteria.
Example:-
1. FIND EMPLOY-VIEW WITH CITY = `FRANKFURT`
SORTED BY NAME PERSONNEL-ID
DISPLAY NOTITLE NAME (IS=ON) FIRST-NAME PERSONNEL-ID
END-FIND
2. FIND EMPLOY-VIEW WITH CITY = `PARIS`
WHERE JOB-TITLE = `INGENIEUR COMMERCIAL`
DISPLAY NOTITLE CITY JOB-TITLE PERSONNEL-ID NAME
END-FIND |
|
Back to top |
|
 |
monasu1998
Active User

Joined: 23 Dec 2005 Posts: 176 Location: India
|
|
|
|
Hi All:
READ is to access one or multiple records with different keys even if elements of the key are unknown.
It has 3 variations
READ IN LHYSICAL SEQUENCE:it retrieves data in the order the data stored to the database
READ BY ISN: it retrieves data in ISN order
READ LOGICAL: it retrieves data in order of the value of a key field(descriptor)
The FIND statement is used to retrieve records from the database based on a search criterion consisting of fields defined as descriptors (keys).
It has several variations like FIND NUMBER, FIND UNIQUE, FIND FIRST etc.
READ is for sequential access of data where as FIND is for random access |
|
Back to top |
|
 |
|