Searching text field

Hello everyone, I have a search box and I would like to
search through a text field in my database. I have been researching
on the best way to do this but not too much luck. I am not the
admin of the server holding my site but I can always ask to see if
they have functions that you guys recommend. I use a mysql database
and I have the search working but it only pulls up records that
match the keyword that I have entered. If the user types in pop and
goodpop is in the database nothing comes up. The keyword field in
my data base is populated by the user through a from and it will
consist of many key words.
I hope this awesome forum can help me out.
JN

when using LIKE you do not need to do the analysis more than
once ... you are doing the same comparison 3 times in the code you
posted.
all you need is :
Where CustKeyWords LIKE '%#form.crud#%'
however, if you actually use a phrase like "pop of can" and
expect to find "can of pop" that will not work because LIKE looks
for the existance of the word or phrase in any row of data for that
field.
i.e. "pop" will result in finding any record with "pop" in it
... "can of pop", "pop can", "lollipop", "popsicle", etc.
however the phrase "pop of can" has no relavent bearing to
"can of pop"
If you want to find records that contain ANY of the owrds
entered, and not just the exact phrase, then you will have to
divide the phrase up into individual words and that is when you
will need the OR function to search for multiple match potentials
in the case of "pop of can" you would divide that into :
crud1 = "pop"
crud2 = "of"
crud3 = "can"
then your code would be something like
Where CustKeyWords LIKE '%#form.crud1#%' or CustKeyWords LIKE
'%#form.crud2#%' or CustKeyWords LIKE %'#form.crud3#%'
This is just a concept and would need to be tweaked to allow
for any combination of words, since you wouldn't necessarily always
have 3 words on a phrase and wouldn't necessarily have a phrase at
all ... just a word.
An array or list would likely work best for this.
It is always usually a good idea to remove common words from
phrases as well (i.e. "of" , "and" , "the", etc) because otherwise
you could end up with pretty much every entry from your database.

Similar Messages

  • Can't include a reset button/process that cleans a search text field

    Hi all
    Using apex 3.0.1 on a XE edition
    In my app there's a report that displays a lot of records.
    I included an text field item, where user can type a search criteria, then i added a button called "search" which, when submitted, display the records where search criteria is included.
    Now, my problem is that i can't put a "reset" button, which, when submmitted, is supposed to clear the search text field, so the report display all records.
    I tried adding a branch that triggers when reset buttos is pressed, clearing cache of search text field. It didn't worked, search string keeps on showing on text field.
    Then i changed the process, instead of clearing cache, setting search text field item with a value of null. Didnt work either...
    Does anyone have a good example of thjis type of reset button???
    tnks in advance....
    Fernando

    yes Earl, i know it's pretty standard...but i got some trouble... anyway, i think it was just a "lapsus brutus" o' mine... It's solved now and here's what i did:
    I created a text field button (where search string will be typed), a "submit as Go" button, and a "submit as reset" button. Then i created an uncondicional branch to same page, then i created a Clear Cache for Item process, where the text field cache is cleared, conditioned when "submit as reset" button is pressed.
    That solved the problem, thnx very much for your help
    fernando

  • Looking for a tool to search text fields in about 1000 reports installed on Business Objects Xi R3

    Hi,
    i am looking for a tool, program that can search all our reports installed on Business Objects Xi R3 for specific content in text fields and formulas.
    We used a couple of years ago .rpt inspector, that worked pretty well for our purpose.
    Unfortunately  this is Win XP & Win Server 2003 only, so we can't reuse it anymore.
    (I know there are way of getting WinXP that in a VMware, but that is not an option in our company.)
    So i am interested , if there is another tool out there, which can help us?
    regards Alex
    btw we are using Business Objects XI R3 (SP7) with reports deisgned on crystal reports designer 2008

    Hi,
    i am looking for a tool, program that can search all our reports installed on Business Objects Xi R3 for specific content in text fields and formulas.
    We used a couple of years ago .rpt inspector, that worked pretty well for our purpose.
    Unfortunately  this is Win XP & Win Server 2003 only, so we can't reuse it anymore.
    (I know there are way of getting WinXP that in a VMware, but that is not an option in our company.)
    So i am interested , if there is another tool out there, which can help us?
    regards Alex
    btw we are using Business Objects XI R3 (SP7) with reports deisgned on crystal reports designer 2008

  • Safari 5.1.2 keeps changing text field randomly on text input

    Hello everybody.
    Safari keeps changing the text field on input, do you know how to correct this issue?
    Here is an example:
    Let's say I load www.google.com, it appears in the safari window as usual.
    Suppose I begin to type a search in the google search field at the top right of the safari window (not the one on the google page)
    if when doing this the sentence is long for the search, at some point randomly, the rest of the text will be entered this time in the google search text field on the google page! (which is the very next text field) So when I hit enter it makes google search half of my request...
    Safari changed the text field I was into with no warning. I want to say I do not press tab at any moment.
    This is annoying really, and this does not appear anywhere else than in Safari. It seems the issue is not systematic, but appears quite often.
    I have no universal access setting except "enable access for assistive device"
    I had to check this box upon installing a software in the past but I can't remember what it was.
    Perhaps the problem I have is linked to some window refreshing?
    Thank you for your suggestions or help
    Mac Pro, 10.6.8

    Try deleting the cache associated with Safari ...
    Quit Safari.
    Go to ~/Library/Caches/com.apple.Safari/Cache.db.
    Move the Cache.db file to the Trash.
    Relaunch Safari to test.
    I had to check this box upon installing a software in the past but I can't remember what it was.
    Open System Preferences > Universal Access
    Make sure the box next to:  Enable access for aassitive devices is deselected.

  • Workarounds for searching a text field in SQL Server 2000

    Hi,
    I have a need to search within a text field in SQL Server 2000. In the
    limitations section it notes that this is not possible. Is there a
    recommended workaround for this in terms of performance? I have no way
    of knowing the length of the text field in advance, and this could be
    fairly large. Also, the number of objects that could contain the text
    can be fairly large as well.
    Thanks in advance,
    Khamsouk

    Note that some databases (or Oracle, at least) provide alternatives to
    LIKE '%foo%' that are more efficient for large text blocks, given that
    you have the appropriate indexing plugins etc. etc.
    To use one of those types of search operators, you'd have to put
    together a custom extension.
    -Fred
    Fred Lucas <[email protected]> wrote:
    I'm assuming that when you say 'a text field', you're referring to a
    SQLServer TEXT field, as opposed to just any old field that contains
    text.
    Like I said, I'm by no means a SQLServer pro, but I just ran:
    SELECT CLOBSTRINGX
    FROM LOCATORTESTOBJECTX
    WHERE CLOBSTRINGX LIKE '%o%';
    and got back my test row with 'foo' in the CLOBSTRINGX column.
    CLOBSTRINGX is a TEXT column.
    So, it is possible that our stringContains() extension will just work.
    But then again, maybe not. I'm guessing it will.
    Give it a try and, if you get an error, post the generated SQL (turn on
    SQL output by setting the com.solarmetric.kodo.Logger property to
    'stdout') and the error that you get. Also, try executing the generated
    SQL directly against your data store to see if it works there.
    -Fred
    Khamsouk Souvanlasy <[email protected]> wrote:
    Basically I just want to use kodo's extended stringContains syntax on a
    text field. Is this possible?
    Khamsouk
    Fred Lucas wrote:
    I'm not intimitely familiar with SQLServer's text searching
    capabilities, but I'm confident that you could create a query extension
    that would do what you need it to do.
    What is the SQL that you are trying to generate?
    -Fred
    Khamsouk Souvanlasy <[email protected]> wrote:
    Hi,
    I have a need to search within a text field in SQL Server 2000. In the
    limitations section it notes that this is not possible. Is there a
    recommended workaround for this in terms of performance? I have no way
    of knowing the length of the text field in advance, and this could be
    fairly large. Also, the number of objects that could contain the text
    can be fairly large as well.
    Thanks in advance,
    Khamsouk
    Fred Lucas
    SolarMetric Inc.
    202-595-2064 x1122
    http://www.solarmetric.com

  • Search database fields using single text field

    Kindly advise on how to develop a database search page such
    that there is
    single text field to enter serach string and the results are
    shown on the
    same page.
    ALso guide if there is any extension available for achieving
    the above.

    I understand what you say.
    What I am looking for is a wizard or an extension which
    creates the form, as
    well as writes the SQL string and also generates the results
    page
    (preferably on the sarch page itself).
    I am looking for a google like solution where the site
    homepage has one text
    field, and users can search for all the fields of a database
    to give results
    on the same page.
    Please help.
    "malcster2" <[email protected]> wrote in
    message
    news:gg9g8b$lf9$[email protected]..
    > the simplest way of doing it is to have an input box and
    a submit button
    > in a
    > form,
    >
    > when the submit button is pressed, the text in side the
    input box is
    > posted to
    > a variable.
    >
    > the variable is then inserted into a mysql select
    statement, and the
    > results
    > are then echoed to the screen.
    >
    > all of this using php.
    >
    >
    >
    >

  • Search for a space within a text field

    Hi All
    I am trying to search for a sapce within a text field but sofar not being very successful. I have used:
    FIND search_str
               IN text_str
               MATCH COUNT  lv_mcnt
               MATCH OFFSET lv_moff.
    where search_str = TYPE c VALUE ' '.
    I am looking a way of searching a character within the string using ABAP (like INSTRING in other languages). If you have similiar codes - Could you please post me a copy - Thanks

    HI
    Check this..
    DATA string7(30) TYPE c VALUE 'This is a little sentence.'.
    WRITE: / 'Searched', 'SY-SUBRC', 'SY-FDPOS'.
    ULINE /1(26).
    SEARCH string7 FOR 'X'.
    WRITE: / 'X', sy-subrc UNDER 'SY-SUBRC',
                   sy-fdpos UNDER 'SY-FDPOS'.
    SEARCH string7 FOR 'itt   '.
    WRITE: / 'itt   ', sy-subrc UNDER 'SY-SUBRC',
                       sy-fdpos UNDER 'SY-FDPOS'.
    SEARCH string7 FOR '.e .'.
    WRITE: / '.e .', sy-subrc UNDER 'SY-SUBRC',
                      sy-fdpos UNDER 'SY-FDPOS'.
    SEARCH string7 FOR '*e'.
    WRITE: / '*e ', sy-subrc UNDER 'SY-SUBRC',
                    sy-fdpos UNDER 'SY-FDPOS'.
    SEARCH string7 FOR 's*'.
    WRITE: / 's* ', sy-subrc UNDER 'SY-SUBRC',
                    sy-fdpos UNDER 'SY-FDPOS'.
    Thanks ,
    Praveen

  • Search and Replace values in the text field before values are stored to DB

    Hi,
    In my application there is a question - text area and answer - text field. Problem is, some answers are stored with the single quotes to the DB and I have a problem while retrieving it from the DB. I need to replace the 1 single quotes with 2 single quotes. The values are stored to the DB when the submit button is clicked.
    So I am using the following javascript code:
    italics
    <script type="text/javascript">
    function test()
    var str="&P2_S1.";
    document.write(escape(str));
    </script>
    italics
    I need to call this javascript function, when the submit button is clicked but BEFORE the values are stored to the DB. How can i get this done?
    Please let me know.

    Hi,
    Thanks for the reply.
    Yeah I planned to drop the Javascript idea.
    Now, I am using the PL/SQL code. This is what I am planning to do.
    When the user enters any word like this, Test's, this single quote should be replaced by some special character, #@@#, - what is the PL/SQL code for this?
    Right now my PL/SQL code is:
    begin
    update test set S1=:P2_S1 where name=:APP_USER;
    end;
    so the replacing part should come somewhere before the update statement.... how can I do it?
    from the DB when the values are retrieved, I use the following code:
    select REPLACE(s1,'''','') from test where NAME=:APP_USER; // this works fine.
    Please help me with the replace of the single quote before the update process...

  • How does APEX check for null values in Text Fields on the forms?

    Hello all,
    How does APEX check for null values in Text Fields on the forms? This might sound trivial but I have a problem with a PL/SQL Validation that I have written.
    I have one select list (P108_CLUSTER_ID) and one Text field (P108_PRIVATE_IP). I made P108_CLUSTER_ID to return null value when nothing is selected and assumed P108_PRIVATE_IP to return null value too when nothign is entered in the text field.
    All that I need is to validate if P108_PRIVATE_IP is entered when a P108_CLUSTER_ID is selected. i.e it is mandatory to enter Private IP when a cluster is seelcted and following is my Pl/SQL code
    Declare
    v_valid boolean;
    Begin
    IF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := TRUE;
    ELSIF :P108_CLUSTER_ID is NOT NULL and :P108_PRIVATE_IP is NULL THEN
    v_valid := FALSE;
    ELSIF :P108_CLUSTER_ID is NULL and :P108_PRIVATE_IP is NOT NULL THEN
    v_valid := FALSE;
    END IF;
    return v_valid;
    END;
    My problem is it is returning FALSE for all the cases.It works fine in SQL Command though..When I tried to Debug and use Firebug, I found that Text fields are not stored a null by default but as empty strings "" . Now I tried modifying my PL/SQL to check Private_IP against an empty string. But doesn't help. Can someone please tell me how I need to proceed.
    Thanks

    See SQL report for LIKE SEARCH I have just explained how Select list return value works..
    Cheers,
    Hari

  • Expanding text field in table

    Hi,
    I’m pretty inexperienced with Live Cycle and was hoping I could get some help using text fields within a table.
    I’m creating a form with a table into which the user enters information. I’d like the row height in the table to adjust to the amount of text entered into the text field so as that if necessary the table will expand onto a subsequent page.
    The table exists within a subform and the text fields exist with in the table. In searching this forum I seen talk of dynamic tables but not sure how to achieve this.
    Any help would be much appreciated.
    Thanks
    Graeme

    To make the textfields grow you need to select 'Expand to Fit' under height in the Layout tab. In terms of going onto another page you need to select 'Allow Page Breaks within Content' in the Object>Field tab and make sure your subform is flowed not positioned.

  • Text fields in Print Module

    I was really hoping to see the ability to add text fields in the Print module.  In my work, I frequently need to add captions or titles to the prints.  At the moment, I have to round trip to Photoshop to make this happen.  I also make folios (see Brooks Jensen) where that require such captions.  Thanks.

    I could see that being useful too.  As it may not make the final release, and we wouldn't want the request to get lost in beta land, might I suggest adding it as a suggestion on the Feature Request forum http://feedback.photoshop.com/photoshop_family where it can easily be tracked?  If you post the link to your request here, others can also vote on your request.  If you search there, you may even find similar requests that you might like to add your vote to.

  • How to copy text from Excel to a text field in the form?

    Hi All,
    I want to copy a text from Excel or Word file and paste it in a text field in the form, How?
    I tried to use ctrl+c for copy and ctrl+v for paste but it doesn't work!

    hi, i've seen this problem before but can't remember what the solution was...
    but just by searching on this forum resulted in this link
    Re: Copy and Paste
    hope it helps

  • How do I create a form with text fields that can continue to multiple pages with out it over lapping

    I have created a form in Livecycle and have made every object a sub field. But I am still having the same probably. The text field only continues on to a second page and overlaps the footer I have created at the bottom of the page. I am new to livecycle and have tried a lot of different things to fix this problem. Help would be greatly appreciated.

    Hi,
    I've found this blog http://blogs.uoregon.edu/developments/2010/12/29/pdf-making-text-fields-grow-to-accommodat e-text/ and this example file : flowableTest.pdf? Is it close to what you search? I cannot go deeper into example now, but will.

  • Change font color in the Text Field of a Popup Key LOV

    Hello,
    I have a question concerning Popup Key LOV.
    I want to change the font color in the Text Field of the Popup Key LOV Item.
    I searched the forum but I cannot find an answer about this! Although I searched the CSS and the Popup Key LOV Template, but I do not know where to modify the font color.
    Has anyone an idea how to solve that problem?
    Regards,
    Tim

    Hey,
    thank for your reply!
    I use style="color:#000000;" and it work in Firefox, but not in Internet Explorer 7.0!
    And that is not the first time, that there are differences in displaying those tags in the HTML Form Element Attributes and in css files, etc.
    Does anybody know I to solve that?
    Thank you,
    Tim

  • Query a view w/data entered into a text field populated by 2 table fields

    Hello, Looking for advise!!! I have a tabular canvas thats datablock uses a view to populate. In this canvas I have a text field that has been populated with first_name || ' ' || last_name in the database node of the property pallate column name. The text field is not in the table or view. I have created it in the data block and make it a database item. However, I would like to have the user push a search button to go into ENTER_QUERY mode then the user would enter the criteria to search on in this text field. The user would then push button to EXECUTE_QUERY. The result is I retrieve all records. I want any search criteria entered into this field to be used against the last_name field to retrieve any records equal to the search criteria entered, for example A%. Does anyone know if this is possible?

    Hi!
    You have to use PRE-QUERY trigger to compose the search criteria. Below I put an example of it. You have to have at least one item in the block wich is true database item (e.g. it has to exist in table or view on which your block is based). In the following example EMP_DESC is your non-database search item and EMP_ID is the database one.
    Declare
    Dummy VARCHAR2 (2000);
    begin
    if :EMP.EMP_DESC IS NOT NULL and :EMP.EMP_ID IS NULL
    then
    Dummy := '#IN (SELECT emp_id FROM Employees WHERE Upper (emp_first_name)||'' ''||Upper (emp_sec_name) LIKE Upper (''%'||:EMP.EMP_DESC||'%''))';
    Copy (Dummy, 'EMP.EMP_ID');
    end if;
    end;
    Thats it. Note the # sign in the first position of the Dummy assignment. This is required by forms to glue your search criteria and block's where clause. You may analize LAST_QUERY property of your block in order to understand how this work. Remember also to set the QUERY_LENGTH property of the EMP_DESC item to the value that could contain the whole Dummy string (otherwise it will give you an error and cut the mar the query).
    Hope this helps.
    Sergey.
    P.S. And set your EMP_DESC database item property to NO.

Maybe you are looking for