How to search database records effectively

Rauf

Rauf

VIP Member
I need to search database table(F4101.DSC1,F4101.DSC2,F4101.SRTX ) against some inputs(say, 3 text boxes named Search1, Search2, Search3). What I did right now is...
0. Set cIsFound=0
1. Use "Is String in String" function to search "Search1" against F4101.DSC1
2. If found, set a variable cIsFound=1. If not found, proceed to next step.
3. Use "Is String in String" function to search "Search1" against F4101.DSC2
4. If found, set a variable cIsFound=1. If not found, proceed to next step.
5. Use the above steps to do the same for Search2 and Search3
6. At last, suppress the grid line if cIsFound=0

The issue with the code is that it takes too much time to complete the search. Is there any other technique available in JDE to implement the search ?
 
Hi

get a bigger text variable (ie GPTX = 1500 char)

concatenate the 3 fields DSC1, DSC2 and SRTX separate them with an space

then you can do just only one search with is string in string for each text box and searh the match in all DSC1, DSC2 and SRTC at once

at least that part of code will be 3 times faster
 
Good idea !
Yes. It will be 3 times faster
grin.gif
 
Back
Top Bottom