|
|
| Author |
Message |
atulrukmangad
New User
Joined: 10 Apr 2006 Posts: 13
|
|
|
|
This was asked in an interview.
What will be the result of the following and why ?
READ (10) EMPLOY-VIEW WITH EMPLOY-ID = '3'
ACCEPT IF EMPLOY-ID = '3'
REJECT IF EMPLOY-ID ='3'
WRITE EMPLOY-ID
END-READ
Assume that EMPLOY-ID =3 exists in the EMPLOYEE table. |
|
| Back to top |
|
 |
References
|
Posted: Tue May 02, 2006 10:09 am Post subject: Re: Tricky Question in NATURAL |
 |
|
|
 |
skodidine
New User
Joined: 05 Apr 2006 Posts: 6
|
|
|
|
if records exist with EMPLOY-ID = '3' within the first 10 READS, then they will be written because:
"If an ACCEPT condition is satisfied, the record will be accepted and consecutive ACCEPT/REJECT statements will be ignored."
Sanjay |
|
| Back to top |
|
 |
rahul_mf Warnings : 1 New User
Joined: 13 Sep 2005 Posts: 13
|
|
|
|
Sanjay , you are absolutely right.
But I dont know why you have written:-
"if records exist with EMPLOY-ID = '3' within the first 10 READS"
Because the statement :-
READ (10) EMPLOY-VIEW WITH EMPLOY-ID = '3'
Means that it will read those first 10 records which satisfy the condition
EMPLOY-ID = '3' . |
|
| Back to top |
|
 |
skodidine
New User
Joined: 05 Apr 2006 Posts: 6
|
|
|
|
ooops!! Sorry, didnt read the statement correctly, yes it will pick up the first 10 records that have EMPLOY-ID = '3'. My mistake.
Sanjay |
|
| Back to top |
|
 |
rahul_mf Warnings : 1 New User
Joined: 13 Sep 2005 Posts: 13
|
|
|
|
No probs  |
|
| Back to top |
|
 |
Bidzoniy
New User
Joined: 04 May 2006 Posts: 1
|
|
|
|
Can somebody provide the list of the possible Natural/Adabas interview questions (at leat some of them) or point me where I can find them
Thanks |
|
| Back to top |
|
 |
naveen_desireddy
New User
Joined: 29 Aug 2005 Posts: 9 Location: Hyderabad, India
|
|
|
|
if records exist with EMPLOY-ID = '3' within the first 10 READS, then they will be written because:
"If an ACCEPT condition is satisfied, the all the record's will be accepted
irrespective of other conditions |
|
| Back to top |
|
 |
|
|