This content has been marked as final. Show 8 replies
Every version of Oracle Forms I have worked with (Forms 4.5 - 11g) has automatically trimmed spaces from CHAR fields. Oracle allows you to evaluate spaces by enclosing the string value in Double-Quotes ("Jeff "). From forms, I don't know for certain that typing "Jeff " in your field will work as I don't know for certain if Forms 4.5 supports this. I can tell you that in Forms 10g, adding the double-quotes does not work - at least not in the quick test I conducted. If you goal is to search for any instance of 'Jeff' why not just include the wildcard "%" automatically in your query code?
CraigB my goal is to be able to search a phrase containing two or more words. And as i wrote here before: Trriger is firing every 500ms and it takes information from field and query (like filter [adding ||'%']) with it my table. But its impossible to write word and after that a space (so its also impossible to write "Jeff[space]") because every time timer is triggering, Oracle Forms is leaving the field we are talking about, and trims it from spaces.
NAME$SURNAME ___ ID
Jeff Long 1
Jeff Short 2
Mark Spencer 3
Karol Kowalski 4
^ This should filter table with:= "Jeff S||%" and it does (im using ||% concatenation later in script) BUT only when u write in search field "Jeff_S" (using _ not space) or u write "Jeff S" fast enough (<500ms) to avoid TRIGGER: when timer expired, because when it catches u in a moment that your search Field looks like "Jeff " (with space at the end) it trims last space from search field and it is impossible to search Jeff with specified surname ;)
is it clear now? :) sorry 4my english ;P
Edited by: lapa on 2011-09-01 07:32
because every time timer is triggering, Oracle Forms is leaving the field we are talking about, and trims it from spaces.Yes, this is an annoying limitation of Timers; which begs the question "Why do you need to use a Timer?" It sounds like you are trying to implement some type of auto-reducing list as the user types their search criteria. Given the fact that you are using Oracle Forms 4.5, I would recommend you simply let the user enter their search criterea and then have them click a search button or use the default functionality of Enter Query mode and Execute Query (F7 and F8 if I remember correctly).
is it clear now?Very clear! I've run into this very issue myself. It forced me to question whether I needed the Timer or not and if yes, to question if I had the delay set appropriatly. Perhaps a 500 millisecond delay is too short and your users need more time to enter their search criteria?
When data table\view to search is quite large (about 20 columns) and every column is important, there are 20 filter fields. Having to press the button every time to search and find out if entered data correctly filters our table is quite annoying :D So "the need" of live search is rather a "must have" option. Looking at ur post count makes me pretty sure that its almost impossible :( :D
Edited by: lapa on Sep 1, 2011 10:25 PM
The problem with the Timer is that the Focus leaves the current item (this is true in Forms 10g as well). This is what causes the field to loose the trailing space.
For your situation, another option would be to reduce the list after they have finished entering the criteria in the search field. You will still need to use a Timer, but the Timer will fire in response to a When-Validate-Item (WVI) trigger and is not a repeating timer. In other words, you user would enter their criteria in the field and the WVI trigger will create a 1 millisecond non-repeating timer. The When-Timer-Expired (WTE) trigger will then requery your form similar to what you are doing in your timer now - only specific for the field. Unfortunately, you would have to do this for each field you want to semi-automatically reduce your displayed records on. It's a bit of work, but it might get you close to what you want. ;-)
here is the complete solution - find the attachment
here i've done auto complete lov like google search hint
using oracle 6i........ and 10g database
its also possible in 10g developer suite