en@frrom
24th June 2005, 13:41
I have a multi-occ display session, in which the user enters search arguments on top half of screen, and results are immediately displayed (upon hitting tab on each field) in the bottom half of the screen. So what I do in the script is a query.extend.where and a rebuild.query/execute.first.set after each search field.
So far I didn't enable wildcards, i.e. table field contains "ABCDEFGHI" and user enters "AB" gives result, but if user enters "BC" it doesn't give result. Now there was a request to enable wildcard.
I know there normally is an option to use pos(), but can I get this working also with my query.extend.where clause? Same thing with LIKE operator; I have no idea how I can get that working; made several attemps, so far no result...
Here is part of my code:
nama = strip$(shiftl$(nama))
set.max(nama.t)
nama.t = nama & nama.t
query.extend.where("tccom100.nama inrange :nama and :nama.t" &
" and tccom100.seak inrange :seak and :seak.t" &
prst.string &
" and tccom100.fovn inrange :fovn and :fovn.t" &
" and tccom100.cadr refers to tccom130" &
" and exists (select tccom110._index1" &
" from tccom110" &
" where tccom110._index1 = {:tccom100.bpid})" &
" and tccom130.namc inrange :namc and :namc.t" &
" and tccom130.hono inrange :hono and :hono.t" &
" and tccom130.name inrange :name and :name.t" &
" and tccom130.pstc inrange :pstc and :pstc.t" &
" and tccom130.ccty inrange :ccty and :ccty.t")
So far I didn't enable wildcards, i.e. table field contains "ABCDEFGHI" and user enters "AB" gives result, but if user enters "BC" it doesn't give result. Now there was a request to enable wildcard.
I know there normally is an option to use pos(), but can I get this working also with my query.extend.where clause? Same thing with LIKE operator; I have no idea how I can get that working; made several attemps, so far no result...
Here is part of my code:
nama = strip$(shiftl$(nama))
set.max(nama.t)
nama.t = nama & nama.t
query.extend.where("tccom100.nama inrange :nama and :nama.t" &
" and tccom100.seak inrange :seak and :seak.t" &
prst.string &
" and tccom100.fovn inrange :fovn and :fovn.t" &
" and tccom100.cadr refers to tccom130" &
" and exists (select tccom110._index1" &
" from tccom110" &
" where tccom110._index1 = {:tccom100.bpid})" &
" and tccom130.namc inrange :namc and :namc.t" &
" and tccom130.hono inrange :hono and :hono.t" &
" and tccom130.name inrange :name and :name.t" &
" and tccom130.pstc inrange :pstc and :pstc.t" &
" and tccom130.ccty inrange :ccty and :ccty.t")