progress 4gl:how to retrive database record that satisfies all the keywords entered by user...

Status
Not open for further replies.
S

Sri Nivas

Guest
the keywords are entered by user i.e any number of keywords,it may be one or more. i take a fill-in-field for taking it as input and search that all pairs of keywords match a database record means ,i will display on a browse...but that record must satisfy the all keywords entered by user,if not satisfied means,it will display individual keyword result. thankyou sir-------the code i write is ::::ASSIGN ENTRYcount = (NUM-ENTRIES(hi:SCREEN-VALUE)).

REPEAT pos = 1 TO ENTRYcount : ASSIGN keywordi = ENTRY(pos,trim(hi:SCREEN-VALUE)). FOR EACH db1.vehicles WHERE vehicles.ad-num MATCHES keywordi OR string(vehicles.sl-num) MATCHES keywordi OR vehicles.product-id MATCHES keywordi OR vehicles.product-name MATCHES keywordi OR string(vehicles.amount) MATCHES keywordi NO-LOCK: FOR EACH db2.service WHERE db2.service.ad-num = db1.vehicles.ad-num NO-LOCK: /* IF vcount EQ 0 AND scount LT 1 THEN / / DO: */ FIND ttservice WHERE ttservice.service-num = service.service-num NO-LOCK NO-ERROR . IF AVAILABLE ttservice THEN DO:

END.
ELSE
DO:

CREATE ttservice .
ASSIGN ttservice.ad-num = vehicles.ad-num
ttservice.sl-num = vehicles.sl-num
ttservice.sl-id = service.sl-num
ttservice.product-id = vehicles.product-id
ttservice.service-num = service.service-num
ttservice.product-name =vehicles.product-name
ttservice.purchase-amt = vehicles.amount
ttservice.service-amt = service.service-amt NO-ERROR .
END.
END.

Continue reading...
 
Status
Not open for further replies.
Top