View previous topic :: View next topic
|
Author |
Message |
Muthukumar.PLindia
New User
Joined: 03 Jul 2006 Posts: 51 Location: Chennai
|
|
|
|
could any one say the difference b/w search and search all....
search(serial)
search all (binary)
thats ok...
but wat will be the result set for both...
Will search all takes all the possible matches from an array ..please clarify me.. I need to know th eresult set for a search performed |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi muthu,
Both will search the particular element in array.
Search: is used for sequential search
Search all : is for binary search for this table should be in sorted order.
Result will always be same ...but difference is in algo
In bianry serach it will check mid element first if search element is greater tahn mid element then next search will be in upper half..then so on....
Hope it is clear now |
|
Back to top |
|
|
Muthukumar.PLindia
New User
Joined: 03 Jul 2006 Posts: 51 Location: Chennai
|
|
|
|
thanks guptae for clarifing it...
U said result is same....
so in a array if it finds 4 matches all these 4 matches will be identified in a single (search .... end-search) execution, or do we need to perform it in a loop for every matches......
My requirement is to find retrieve all the matches |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi,
By both the search i think u cant get all the occurance contol will go to next sentence as soon as u find one match.
Sequential search
SEARCH table [VARYING pointer]
[AT END statement1]
WHEN condition
statement2.
Search all syntex
SEARCH ALL table [AT END statement1]
WHEN condition
statement2.
So u need to add logic to get all the matches . |
|
Back to top |
|
|
|