Results 1 to 3 of 3
  1. #1
    Join Date
    May 2004
    Location
    Sydney
    Posts
    3

    Question Unanswered: query using free text

    hey there
    just wanting to know how to do the following:

    1) take a search string and store it as a parameter
    2) use that parameter as the query in another form.

    eg suppose i wish to search for 'Hilton', it should store '%Hilton%' as parameter mysearch. then use mysearch in a new form with the query:

    Code:
    select accommodation_name, accomm_rating from accommodation
    where accommodation_name like mysearch;
    thanks

  2. #2
    Join Date
    Mar 2004
    Location
    Berkshire, UK
    Posts
    186
    all you need to do is declare a variable, lets say vMySearch varchar2(100)
    and your query would be :
    select accommodation_name, accomm_rating from accommodation
    where accommodation_name like '%'||vMySearch||'%'
    There are 10 types of people in the world, those that know Binary and those that don't.

  3. #3
    Join Date
    May 2004
    Location
    Sydney
    Posts
    3
    thanks alot. it worked out well.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •