Accent insensitive + Search for 2 non consecutive keywords

Hi,
In APEX, I have a query the search into a list of TITLE (TIT), with or without accents. I cannot search for 2 non-consecutive word in my title and have the result.
Here an example:
SELECT
"ID","TIT"
from   "REGDOSSIERS" "RDO"
where
instr(TRANSLATE(UPPER("TIT"),'ÁÂÈÉÊÍÓÚÜ','AAEEEIOUU'),upper(nvl(:P1_REPORT_SEARCH,"TIT")) ) > 0
TIT
Last name of the resolution
King Henry the Sixth
The Gazette
The Comedy of Errors
La vie enchanté
Le bêtes et les oiseaux1- If I look for: Last Name_, I have this result:
TIT
Last name of the resolution2- If I look for: Last resolution*,
I have NO RESULTS
My Question: How to I rewrite my query to have be able to look for 2 keywords non consecutive in the field,
thanks
Roseline, Quebec, Canada
Edited by: user8772975 on 2009-09-04 10:47
Edited by: user8772975 on 2009-09-04 10:49
Edited by: user8772975 on 2009-09-04 10:50
Edited by: Roseline on Oct 1, 2009 7:27 PM

Hi,
If you know the order of the keywords (that is, if 'LAST' must come before 'RESOLUTION'):
WHERE  str  LIKE '%LAST%RESOLUTION%'where str is the string with accents standardized.
Now, since you're starting with a variable like 'LAST RESOLUTION', you need to convert it to '%LAST%RESOLUTION%', so say
WHERE  str  LIKE '%' || REPLACE ( :p1_report_search     -- TRANSLATE would work, too
               || '%'Watch out for the "mother is in chemotherapy" problem.
That is, if str = 'AMY''S ORDEAL WITH CHEMOTHERAPY", and :p1_report_search = 'MY MOTHER', you'll get a match, because str contains the 2-character sibstring 'MY' and the 6-character substring 'MOTHER' in that order.
If that's not what you want, then you can search on whiole words only, like this:
{code}
WHERE ' ' || REPLACE ( str
          , ' '     -- 1 space ...
          , ' '     -- ... becomes 2 spaces
     || ' ' LIKE '% ' || REPLACE ( :p1_report_search     -- TRANSLATE won't work, now
                    , ' % '     -- spaces before and after wild-card
               || ' %'
{code}
This assumes that all words are delimited by spaces.
If you want punctuation or other whtiespace (like tabs) to delimit words, that can be done, too.
Edited by: Frank Kulash on Sep 4, 2009 2:09 PM
Added whole-word example.

Similar Messages

  • How to apply an accent-insensitive search to an interactive report?

    Hello all!
    I'm trying to put an accent-insensitive search on an interactive report here. For example, if I'm on the page that has the interactive report and if I click the column header of the interactive report, I get to see a search bar that dynamically shows the results that match your input. Now, when I enter "jager", I want to see *"Jägermeister"* as a search result. The search must be accent-insensitive, so that I don't have to enter the ä every time.
    My code is as follows:
    SELECT name
    FROM food_1
    WHERE name LIKE 'Jagerme%'
    AND NLSSORT(name) IS NOT NULL
    ORDER BY NLSSORT(name, 'NLS_SORT=GENERIC_M_AI');As you can see, I first tried getting a result through the SQL Command. It should return the row that has "Jägermeister" as name. However, it doesn't. It tells me "No data found". So, how do I alter my NLSSORT to search accent-insensitive?
    Some extra information, I edited the interactive report source to the following:
    SELECT DISTINCT a.name, a.foodid
    FROM food_1 a INNER JOIN foodunit_1 c
    ON a.foodid = c.foodid
    WHERE a.foodlanguageid = :P17_SET_LANGUAGE
    AND NLSSORT(a.name) IS NOT NULL
    ORDER BY NLSSORT(a.name, 'NLS_SORT=GENERIC_M_AI');I also tried doing ALTER SESSION before the SQL code, but it still gives me the same result: No data found.
    I'm using APEX version 4.1.1.00.23.
    Help and suggestions are more than welcome. ;)
    Thanks in advance,
    Magali

    I found it out!
    It's really ridiculous, actually.
    Remember this code?
    execute immediate ('ALTER session SET NLS_COMP=LINGUISTIC');
    execute immediate ('ALTER session SET NLS_SORT=BINARY_AI');Well, this code is perfectly fine. Only, it doesn't execute. This is because it was misplaced...This process is not executed when you place it in the current authentication scheme, under the "Post-Authenticatoin Process" part.
    You might wonder why this is, but I have the explanation to that.
    You see, when you use an interactive report, the page processing isn't executed when you use the search function of that interactive report... Because it's an interactive report, I guess.
    BUT.
    An ALTER SESSION from the security attributes, that will execute.
    So, the solution to my problem was, in this case:
    Go to "Application" --> "Shared Objects" --> "Security Attributes" --> "Database Session" --> "Initialization PL/SQL code". In there, you need to put:
    BEGIN
    EXECUTE IMMEDIATE 'ALTER session SET NLS_COMP=LINGUISTIC';
    EXECUTE IMMEDIATE 'ALTER session SET NLS_SORT=BINARY_AI';
    END;By doing this, there's no longer any need to edit the source code of the report!
    So, that's the solution. I can finally enter text without special characters in it, and get the corresponding data, with special characters... Ahh. :)
    I hope this is helpful to others as well now. ;)

  • Accent insensitive Search - plz help me correcting this query

    Hello,
    I just realized that with that query, if I search for "Montreal" (without the accent), I have all the following results, which is what I want
    SELECT
    "ID","TIT"
    from   "REGDOSSIERS" "RDO"
           where
             TRANSLATE(UPPER("TIT"),'ÀÂÉÈÊÎÔÛÙÜ','AAEEEIOUUU')
             like upper(nvl(replace('%' || "P1_REPORT_SEARCH || '%',' ','%'),"TIT"))
    RESULTS
    TIT
    Annuaires Lovell (Montréal et banlieue)
    Juridiction royale de Montréal. Dossiers, 1677-1769
    Montreal Witness, 1845-1938
    {code}
    But how to change it so when I look for: "Montréal" (with the accent) , I have also the same results? Right now, with Montréal, I have nothing
    thanks,
    Roseline
    Edited by: Roseline on 2009-10-01 18:58
    Edited by: Roseline on Oct 1, 2009 7:34 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    If you are on Oracle 10g you can use regexp expressions to do the search.
    Example
    with testdata as (select 'Montreal' txt from dual
                      union all select 'Montréal' txt from dual
                      union all select 'Montreâl' txt from dual
                      union all select 'Montreaux' txt from dual)
    /* end of test data creation */
    select txt from testdata
    where regexp_like (txt, 'Montr[[=e=]]al');
    txt
    Montreal
    Montréal[[=e=]] would be an equivalence class for the letter "e" and includes also searches for é, è, ê etc.
    The best solution mainly depends how your search string is build.
    If you just want to sort, then the nlssort function would be useful.
    Mentioning Nlssort I remembered there is a much better way to implement Accent insensitive search. You just need to set your NLS_SORT parameter correctly. Either to BINARY_AI (the AI means accent and case insensitiv) or add _AI to your nls langage.
    example
    ALTER SESSION SET NLS_COMP=LINGUISTIC;
    alter session set nls_sort = 'FRENCH';
    with testdata as (select 'Montreal' txt from dual
                      union all select 'Montréal' txt from dual
                      union all select 'Montreâl' txt from dual
                      union all select 'Montreaux' txt from dual)
    /* end of test data creation */
    select txt from testdata
    where txt = 'MONTREAL';
    no rows selects
    /* now change the nls sorting */
    alter session set nls_sort = 'FRENCH_AI';
    with testdata as (select 'Montreal' txt from dual
                      union all select 'Montréal' txt from dual
                      union all select 'Montreâl' txt from dual
                      union all select 'Montreaux' txt from dual)
    /* end of test data creation */
    select txt from testdata
    where txt = 'MONTREAL';
    txt
    Montreal
    Montréal
    MontreâlEdited by: Sven W. on Oct 2, 2009 8:34 AM
    Edited by: Sven W. on Oct 2, 2009 10:22 AM - corrected misleading regexp example.

  • Search for images using Keywords Problem.

    1) In LR4, Search for images using Keywords (click on arrow next to Keyword).
    2) Select image, export to PS6, save as Tif.
    3) Tif retains all Keywords when it appears in LR
    4) Despite that, image does not show up in the same 'Search for images using Keywords'.
    Can anyone help with this, it is frustrating me!

    V. 4.1
    Thanks, I will try, but it seems to be an inconsistent problem.
    Simon Fletcher
    Simon Fletcher Photography
    Woody's Nest
    Newton of Kinkell
    by Conon Bridge
    Ross-shire
    Scotland
    UK  IV7 8AS
    Tel: 01 349 864 830
    Web: www.simonfletcherphotography.co.uk
    Work:
    The Glass Scribe
    Tel: 01 349 867 088
    Email: [email protected]
    Web: www.glassscribe.com

  • When I click on the Start Icon and type the name of a file I am searching for none appear.

    When I click on the Start Icon and type the name of a file I am searching for none appear.
    Using Widows 7

    Are you searching for a file that you downloaded via Firefox?
    If that is the case then you can check the Download Manager (Tools > Downloads) and if that file is listed there then right click that entry and choose > Open Containing Folder. If that entry is grayed then the file is no longer in the original download location and possibly removed by AV software.

  • Accent insensitive search without nls_comp

    Is there a function to make oracle search accent insensitive? I can't use nls_comp so I would like to know if there is another way to accomplish it.
    Thanks
    M

    Obviously your unknown database version running on an unknown OS is less then 11.1.0.7 . Statement from Oracle:
    Known problems using NLS_COMP=LINGUISTIC.
    While you can use LIKE with NLS_COMP=LINGUISTIC in 10.2 , we recommend to
    use 11.1.0.7 seen using linguistic index for like operator is an 11g new feature ......
    In other words there's a solution, when running the latest patchset for 11gR1.
    Werner

  • [tip] search for / selecting NO keywords (selection photos without a keyword)

    Probably it is old news but I couldn't find it here that fast.
    I have 20.000 photos, some have a keyword(s) some have not. So I searched for a selection of photographs without a keyword. But there is none.
    The trick is to add a special keyword you normally not use like (only) "_" (underscore) to all photos without a keyword. But there is no way to select photos wihtout a keyword... So I came up with a two step strategy and this trick only cost 2-3 minutes with 20.000 photos:
    Add the "_" keyword to all you photos.
    Select all photos with a real keyword by shift clicking on all keywords tags except "_".
    Remove the "_" keyword from those photos.
    Now select the "_" keyword or search on the "_" keyword.
    A how to, in 14 steps:
    1. Hit G, goto library (in left panel) and click on "all photographs"
    2. Select all photos by pressing ctrl-a
    3. Wait till LR is ready displaying all used keywords in the right keywords panel
    4. In right panel under keywording/keyword tags add the keyword "_"
    5. Wait till LR is ready updating all your photos (20.000 photos: 1 minute)
    6. Goto "Keyword tags" in the left panel
    7. Select the (suppose the second) keyword just after the "_" keyword by left clicking.
    8. Scroll down till the end in the keyword list
    9. Now, shift click on the last keyword
    10. You now selected all keywords except the "_" keyword and all are highlihted
    11. Select all photo's (ctrl-a)
    12. Wait till LR shows all the keywords in the Keywording/keyword tags panel on the right
    check: the keyword "_" should have no asterix like "_*" if so: goto step 1!
    13. Remove the "_" keyword and press enter
    14. Wait till LR is ready
    From now on while selecting the "_" keyword or searching on the keyword "_" LR will only show the photos without a (real) keyword.
    Of course, as soon as you add keyword(s) to your foto(s) you have to delete the "_" keyword.
    Speed tip: when starting keywording, select the photo you like to add real keywords, ctrl-k brings you directly to the keyword tags panel in edit mode, hit backspace (to delete the "_" keyword and start typing your keywords and hit enter or tab when done. Then immediately (of course) the photo dissapears from your "_" keyword selection photos and the next photo is selected and is waiting for you to hit ctrl-k and start again. Look mam, "no mouse used!"
    Have fun!

    >I have 20.000 photos, some have a keyword(s) some have not. So I searched for a selection of photographs without a keyword. But there is none.
    There is actually, and it is much simpler:
    Using the Find Panel, choose Text: Keywords and Rule: Are Empty.

  • Is there a way to search for a specific keyword within the sites to which the bookmarks are linked? I need to search all linked sites in the bookmark folder without having to open each page and "find" manually.

    Currently, I must browse through 50 or so bookmarked pages to see if a specific topic is covered. I would like to be able to search all bookmarked pages at once for a specific keyword. For example, if I have 50 news sites bookmarked and I would like to see which pages have the word "tuna" in them, I would need to open each page individually and do a "find". If I could search all of those pages at once, then I would save an immense amount of time. I have looked on the add-ons and found nothing...

    1. Create a smart album and in the drop down in the top right corner select file status
    2. Check mark the file status box and select 'Offline'
    Now you should have all your 'Offline' (Yellow Exclamation and/or Red Slash) files.
    To reconnect..
    1. Select the missing files.
    2. Go to File and scroll to Manage Referenced Files
    The dialog box will have one of the photos selected
    3. Select the drive and folder that contains the referenced file and select it
    4. Click 'Reconnect All'
    This might not reconnect all of them, but the dialog box will still be open and you can reconnect the ones left.
    Narvon
    Message was edited by: Narvon

  • Searching for a single keyword in lightroom 5

    Hi there,
    I am a newbie to lightroom 5 and I am slowly learning the power of keywords.
    My question is,
    I have 1000's of images of my daughter in my catalog I have key worded all of them. There are some images with her on her own or with me, the mum, nan, granddad etc etc. I have also key worded the photos with, for example me. So on an image the key word is annie, nick. When I go to the 'text' search in the library list I type in annie and every single image of her comes up be it with me the nan, the mum etc. My daughter has hundreds of image with different family members. How do I just get the search to pick "annie" as the keyword and not the rest of the keywords in the catalog.
    For example,
    I know I can do a search like this, annie, !nick, !mum, !granddad etc etc, but this is so time consuming. Is there a character that can tell lightroom that you only want the image of annie with no one else or nothing else.
    I am aware you can select all of the singular images of my daughter and create a collection with just her but this is also time consuming.
    Another way this would be annoying is if you had images of trees for example, some trees might be taken by a water fall, mountain, road, picnic table or just one on its own. you might have hundreds of tree image on there own and hundreds of images of trees with a feature. If you try and search for just a tree or trees with nothing else in the image your search result is going to bring up every single image with a tree in it. Not just the images of a tree.
    Hope this makes some sort of sense. I have searched all over the internet and there doesn't seem to be an option for this. Or maybe I am missing something. If I'm not missing something and this just isn't possible maybe lightroom designers could look at implementing this search criteria in future updates.
    Regards,
    Nick.

    I have tried that and i think i am more confused. Its going to take me a while to learn this stuff. I have done the ! option and have narrowed it down to the images I want and have created a collection with just the images I wanted. I think I am going to have to think ahead with the keywording in the future. I will get there, its all trial and error at the moment.
    Its only a problem at the moment as I have an external hard drive so I have just added 'ADD" all images (over 4000) to lightroom from there as I want to save all future photos I do on the external hard drive. I am reluctant to fill my new IMAC with loads of images and take up loads of space. With photos I do in the future I will be saving on the imac probably and backing up on my external hard drive. The 4000 images are from the last year or so before I got this MAC.
    When I do future photo shoots etc it will be easier to move the images to the correct folders as I will be working on a lot less images. So I believe in the future it will be more managable. Trying to key word 1000's of images at the same time has confused me a bit.
    Cheers for you inputs peeps, appreciate it.

  • Mountain Lion Mail cannot search for non-alpha characters in Subject Lines

    Under 10.8.3, Mail 6.3 often cannot successfully find messages if the search string contains a non-alpha character.
    I have only tested this searching for Subject lines that are KNOWN to contain non-alpha characters
    Specfic examples:
    Subject starts with "[ABC..."
    Mail cannot find it if you search using "[ABC"
    Mail CAN find it if you search using just "ABC"
    Subject contains the numeral "2"
    Mail cannont find it if you enter "2" as the search string...even if you further constrain the search to "Subject contains: 2"
    Other problem characters I have found:
    The failure when using square bracket is a real pain since a lot of mailing lists are tagged using strings wrapped in square brackets.
    Sometimes it WORKS when I include multiple non-alpha characters in the search string, like "55" or "4/19"
    Anyone else see this?

    Please follow these directions to delete the Mail "sandbox" folder.
    Back up all data.
    Triple-click anywhere in the line below on this page to select it:
    ~/Library/Containers/com.apple.mail
    Right-click or control-click the highlighted line and select
    Services ▹ Reveal
    from the contextual menu.* A Finder window should open with a folder named "com.apple.mail" selected. If it does, move the selected folder — not just its contents — to the Desktop. Leave the Finder window open for now.
    Log out and log back in. Launch Mail and test. If the problem is resolved, you may have to recreate some of your Mail settings. You can then delete the folder you moved and close the Finder window. If you still have the problem, quit Mail again and put the folder back where it was, overwriting the one that may have been created in its place. Post your results.
    Caution: If you change any of the contents of the sandbox, but leave the folder itself in place, Mail may crash or not launch at all. Deleting the whole sandbox will cause it to be rebuilt automatically.
    *If you don't see the contextual menu item, copy the selected text to the Clipboard by pressing the key combinationcommand-C. In the Finder, select
    Go ▹ Go to Folder...
    from the menu bar, paste into the box that opens (command-V). You won't see what you pasted because a line break is included. Press return.

  • Searching for spotlight localized keywords list

    Hello,
    I've got to make a list of spotlight keywords, in foreign languages some keywords have been translated, and some have synonimous.
    So there must be somewhere a file where to find this list. I dug in Spotlight package in the Coreservices, nothing, nor in Finder french.lproj for example.
    So if someone knows where is this localized list it would be appreciated.
    Thanks
    Regards
    Vartan

    The slowness is not *the* major inconvenience, maybe I am just a bit sensitive after taking over 3 days to import by reference 50000 photos.
    The issue is that it is very convenient not to have to open an app just to search for and preview a file.
    I have done some more reading, and the XMP thing will only allow me to find the XMP files, not the images, as Adobe has not provided an XMP mdimporter either.  Going that route I will have to search what I want, then for each found XMP search image based on the XMP name.
    I see someone has written an importer, ( CodeNoEvil/LightroomSpotlightImporter · GitHub ), but it appears to only index the image by filename which could make the above easier, but still not optimal.
    I suppose the answer is to write an importer for the XMP files that is smart enough to 'find' the associated image from the XMP data, something that Adobe would be better suited to do.
    I must admit I am surprised, as I thought Adobe supported the mac fairly well.  Guess not.

  • Can pacman search for 2 different keyword at the same time?

    I'm sure this is possible, maybe not only with pacman (but grep or something)
    The other day I was searching for a KDE image viewer.
    pacman -Ss kde (about 3 pages of results)
    pacman -Ss image (about 1 or 2 pages of results)
    pacman -Ss kde | grep image (in some packages only the description is printed out, so I end up not knowing the package name)
    Is there a better way to filter results? Maybe pacman could have something like a +, and one could do something like
    pacman -Ss kde + image

    ah! sweet thanks. I wonder why this didn't appear when I searched the forums. It's all about keywords I guess....

  • Target system install problem (SAPINST searching for Non unicode kernel)

    Hi,
    I'm currently performing a unicode conversion (from 4.7 to EHP4). I am finished with the upgrade and I'm now in the unicode conversion part.
    I have completed the export and selected unicode as the target system. I am done with source system uninstallation and I'm now installing the unicode target system.  I have selected unicode during the parameter selection (it's the default option anyway) but during the part where it will ask for the kernel DVD, it doesn't accept the path of my unicode kernel (and instead looks for the non-unicode kernel) 

    Hi Markus,
    Thanks for your response. This problem is now resolved. It turns out that there are some remaining files from the old /usr/sap/<> and /sapmnt/SID/exe that were not deleted yet (after uninstalling for non unicode system). I proceeded to delete again these files and ensure that there are no files from the non unicode system

  • Search for non-internet Apps for iPod Touch?

    I have an iPod Touch, so I don't always have an internet connection when I am away from my house. I would like to specifically search for apps that don't require an internet connection to run. For example, many of the translation tools rely on Google to translate--I would like a translation app with a built-in dictionary that I can use without having internet access.
    Is there a way to specify a search for only self-contained apps (don't rely on internet) when searching iTunes? Or do I need to open the description for each app to see if it relies on an internet connection?

    No one answered you, but this is exactly what I am looking for too.
    What I have found is that, without an internet connection, the iphone and touch products are little more than a pretty music player. I think they call it 'cloud computing'; focusing data storage and function on remote systems and just using the touch and iphone for access. That appears to be the way their development is going. It works fine when you are always near wifi, but where I work has no wifi and no cell coverage. I've found that for most work tasks, translation, secure documents, gathering data, GPS etc, the PDA or smart phone is a better fit. Those store data and applications locally on the unit itself rather than on the internet somewhere that you won't always be able to access.
    With all the storage space on the touch and iphones, you'd think they could give a little of it over to onboard apps and functions, but until they do, at least there is the PDA.

  • Problems when searching for non-Latin characters

    In my studies I often need to search for Japanese terms. I usually do this from the Smart Search Field to go straight to Google. However, Safari seems not to be able to handle the Japanese characters. For example, I might type 日本 into the Smart Search Field. I would then expect to see results about the country of Japan (for that is what I searched). Instead, I see this: http://puu.sh/1MwvG
    This is pretty much a dealbreaker for me re: Safari. Is there something that will fix it?

    I can't seem to duplicate this.  Are you typing in the same place I am? I see I only have 6.0.1...

Maybe you are looking for

  • ASA 5510: Flapping interface

    Hi all, Yesterday one of the interfaces on my firewall started flapping causing havoc to live services. It has now resolved itself and hasn't done it again but my questions is; is this start of something and what can I do to pre-empt it happening aga

  • Crystal reports 2008 sp3 : An error has occurred while attempting to load t

    Hello, Please forgive me for posting in the CR .NET forum because we are using the full Crystal Reports 2008 product and I did not see a category for it.  If there is a better forum for this question, please let me know or feel free to move it. We ar

  • Can I redeem my gift card with another person?

    I have a gift card I want to share with my husband.  Can he also use it?

  • Actions and Efficiency

    Hi, I was looking through Virum's example of actions and it made me wonder what's the best way to use ActionListener because I saw he used it a different way than I was using. I'm talking about using inner classes (interfaces i believe?) vs the metho

  • Blackberry 8520 wont type

    Non of the button including the call and hang up button are working i can only use the trackpad. anyone know how to fix it?