Accent Insensitive
Hi, how can i create a index in Azure Search that is accent insensitive?
What i want is that the search for the word "João" return the same results than searching for "Joao".
What about stopwords?
Hi, how can i create a index in Azure Search that is accent insensitive?
What i want is that the search for the word "João" return the same results than searching for "Joao".
What about stopwords?
Hi guys... I Have found the link http://azure.microsoft.com/en-us/documentation/articles/search-api-2015-02-28-preview/#LanguageSupport/ and was abble to solve the problem.
Very good!!!
Tnks!
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,
MagaliI 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 LIKE in a stored procedure
Hi!
How is it possible to run a SELECT with accent insensitive LIKE in a stored procedure?
ALTER SESSION SET NLS_COMP=xxx is not allowed in procedure body, so what can be done?
I guess i need the LIKE equivalent of NLSSORT(string, 'NLS_SORT = XDanish_ai').
Is there such a thing?
I need this option per statement, not globally.
I use Oracle 11g.
Regards,
DavidI used this approach:
procedure proc1(
p_1 IN VARCHAR2,
p_out OUT sys_refcursor)
is
m_comp VARCHAR2(80);
m_sort VARCHAR2(80);
begin
select value into m_comp from NLS_SESSION_PARAMETERS where parameter='NLS_COMP';
select value into m_sort from NLS_SESSION_PARAMETERS where parameter='NLS_SORT';
execute immediate 'ALTER SESSION SET NLS_COMP=LINGUISTIC';
execute immediate 'ALTER SESSION SET NLS_SORT=Slovenian_ai'; -- I'm not danish ;)
open p_out for
select * from table_a where name like p_1 order by name;
execute immediate 'ALTER SESSION SET NLS_COMP=' || m_comp;
execute immediate 'ALTER SESSION SET NLS_SORT=' || m_sort;
end;This works, but:
- the NLS affects also ordering, which I don't want
- it does not count 'z' and 'ž' as the same, which was the goal I tried to achieve ... -
Query that treats "accents insensitive" and "case insensitive"
I need to do one query that treats "accents insensitive" and "case insensitive" if possible too.
I need to have the query below ajusted to return both accent or not accent words:
with t as
( select 'xxxELEIÇÕESyyy' text from dual union all
select 'xxxELEIÇOESyyy' text from dual union all
select 'xxxELEICÕESyyy' text from dual)
select text from t
where text like '%eleicoes%'; --> i need some filter that result true for both 3 linesSQL> with t as
2 ( select 'xxxELEIÇÕESyyy' text from dual union all
3 select 'xxxELEIÇOESyyy' text from dual union all
4 select 'xxxeleiÇOESyyy' text from dual union all
5 select 'xxxELEICÕESyyy' text from dual)
6 select text from t
7 where regexp_like(t.text, '(x|X){3}(ELEI|elei){1}([CcÇç]{1})([ÕOõo]{1})(ES|es){1}(y|Y){3}')
8
SQL> /
TEXT
xxxELEIÇÕESyyy
xxxELEIÇOESyyy
xxxeleiÇOESyyy
xxxELEICÕESyyy -
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
MObviously 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 -
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 PMIf 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. -
Pattern Matching Accent Insensitive
I am using the Pattern Matcher class in order to do regex matching.
Is there a way to specify accent insensitive matching.
I have a string aeihAEIH������
when searching for ei
I would like to get 4 matches
1) ae
2) AE
3) ��
4) ��
However, I only get 1) & 2)
Here is my code:
Matcher matcher = Pattern.compile("ae", Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE).matcher("aeihAEIH������")
Is there a way to accomplish this?ehirsch wrote:
I do not want to explicity specify the accented characters in code.
I want that ae should match also against accented characters of any type unlimited.AFAIK, that is not possible. However, I am a mere grasshopper in the regex-world. If my assumptions are incorrect, I am sure I will be corrected by the regex-lords that roam these forums. -
Accent Insensitive collation issue
Hi there.
I'm using visual studio 2005 crystal reports and sql server 2005.
I believe crystal reports is not using sql server's collation for accent insensitive. When I use a RecordSelectionFormula such as:
" Like 'as'" the report is not showing data such as "ananás", although sql server is set to Accent Insensitive, which is a huge problem in our case.
Is there some way to solve this issue?
TIAHello,
Ah, now I see what you are asking, the issue is you need to use wild cards....
Wild cards won't work in the formula editor because the wild card character is a valid character in any text string. No one will ever reserve the "*" or "%", if so they could not be used in any string.
You can use them in SQL because the DB/client SQL interpreter understands what they are and in SQL it is a reserved escape sequence character.
As for a work around in a CR Record Selection formula you can AND the values:
"as" in {Employee.Last Name} AND "a" in {Employee.Last Name} AND "s" in {Employee.Last Name}
Changing the order and also using OR will filter the filter but the logic may not work for all instances.
The only way you would be able to use wild cards is to use a SQL Expression or a Command Object with Parameters. Something where the SQL would/could be used which accepts wild cards.
If Jason Long see's this post he's a SQL guru and uses SQL Expressions and Command Objects extensively and has likely done this already.
Still need to know what DB you are using?
Thank you
Don -
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 PMHi,
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. -
Case INSENSITIVE Columns on Oracle
Hello Friends,
Good Monday for everyone....
I would like to ask you guys if there is a way to create a case INSENSITIVE Columns on Oracle. I used on Sqlserver before the COLLATE sintax, and I was able to make a columns (just that one) INSENSITIVE.
I'm using oracle 10gr2 on Windows plataform and herte is my nls_parameters. My ideia is to search on this column without the need of performing a function UPPER and LOWER and etc...
NLS_LANGUAGE BRAZILIAN PORTUGUESE
NLS_TERRITORY BRAZIL
NLS_CURRENCY Cr$
NLS_ISO_CURRENCY BRAZIL
NLS_NUMERIC_CHARACTERS ,.
NLS_CALENDAR GREGORIAN
NLS_DATE_FORMAT DD/MM/RR
NLS_DATE_LANGUAGE BRAZILIAN PORTUGUESE
NLS_CHARACTERSET WE8MSWIN1252
NLS_SORT WEST_EUROPEAN
NLS_TIME_FORMAT HH24:MI:SSXFF
NLS_TIMESTAMP_FORMAT DD/MM/RR HH24:MI:SSXFF
NLS_TIME_TZ_FORMAT HH24:MI:SSXFF TZR
NLS_TIMESTAMP_TZ_FORMAT DD/MM/RR HH24:MI:SSXFF TZR
NLS_DUAL_CURRENCY Cr$
NLS_NCHAR_CHARACTERSET AL16UTF16
NLS_COMP BINARY
NLS_LENGTH_SEMANTICS BYTE
NLS_NCHAR_CONV_EXCP FALSE
tks a lot
KeenAPC wrote:
No, they mean a setting which makes "APC" or "apc" match "Apc".
There is nothing to be done on 10g, other than building a function based index on the column in question, so that any UPPER() searches are optimized.
Well, as Kamran Agayev already noted CI is available in 10g too. It also worth mentioning FBI creates a hidden column. Also, your statement
In 11g we have the option to set the NLS_SORT parameter so that any searches are case-insensitive (or indeed accent insensitive). Find out more.
is incomplete. NLS_SORT affects nothing but sort:
SQL> connect scott
Enter password: *****
Connected.
SQL> select * from v$version
2 /
BANNER
Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - Prod
PL/SQL Release 10.2.0.4.0 - Production
CORE 10.2.0.4.0 Production
TNS for 32-bit Windows: Version 10.2.0.4.0 - Production
NLSRTL Version 10.2.0.4.0 - Production
SQL> with t as (
2 select 'Max' name from dual union all
3 select 'sam' name from dual union all
4 select 'Joe' name from dual union all
5 select 'max' name from dual union all
6 select 'joe' name from dual union all
7 select 'Sam' name from dual
8 )
9 select name
10 from t
11 order by name
12 /
NAM
Joe
Max
Sam
joe
max
sam
6 rows selected.
SQL> with t as (
2 select 'Max' name from dual union all
3 select 'sam' name from dual union all
4 select 'Joe' name from dual union all
5 select 'max' name from dual union all
6 select 'joe' name from dual union all
7 select 'Sam' name from dual
8 )
9 select name
10 from t
11 where name = 'max'
12 /
NAM
max
SQL> alter session set nls_sort = binary_ci
2 /
Session altered.
SQL> with t as (
2 select 'Max' name from dual union all
3 select 'sam' name from dual union all
4 select 'Joe' name from dual union all
5 select 'max' name from dual union all
6 select 'joe' name from dual union all
7 select 'Sam' name from dual
8 )
9 select name
10 from t
11 order by name
12 /
NAM
Joe
joe
max
Max
Sam
sam
6 rows selected.
SQL> with t as (
2 select 'Max' name from dual union all
3 select 'sam' name from dual union all
4 select 'Joe' name from dual union all
5 select 'max' name from dual union all
6 select 'joe' name from dual union all
7 select 'Sam' name from dual
8 )
9 select name
10 from t
11 where name = 'max'
12 /
NAM
max
SQL> with t as (
2 select 'Max' name from dual union all
3 select 'sam' name from dual union all
4 select 'Joe' name from dual union all
5 select 'max' name from dual union all
6 select 'joe' name from dual union all
7 select 'Sam' name from dual
8 )
9 select name
10 from t
11 where name like 'm%'
12 /
NAM
max
SQL> select 'Max' name from dual union
2 select 'max' name from dual
3 /
NAM
Max
max
SQL> with t as (
2 select 'Max' name from dual union all
3 select 'sam' name from dual union all
4 select 'Joe' name from dual union all
5 select 'max' name from dual union all
6 select 'joe' name from dual union all
7 select 'Sam' name from dual
8 )
9 select distinct name
10 from t
11 /
NAM
sam
Joe
joe
max
Sam
Max
6 rows selected.
SQL> As you can see, NLS_SORT alone works on sort but not on "searches". We also need to set NLS_COMP, which by default is BINARY. Prior to 10g R2 (I am not 100% sure, it could be prior 10g), the only NLS_COMP choice, besides BINARY, was ANSI. However, ANSI does not work with all comparison operators (e.g. does not work for LIKE, UNION, DISTINCT):
SQL> alter session set nls_sort = binary_ci
2 /
Session altered.
SQL> alter session set nls_comp=ansi
2 /
Session altered.
SQL> with t as (
2 select 'Max' name from dual union all
3 select 'sam' name from dual union all
4 select 'Joe' name from dual union all
5 select 'max' name from dual union all
6 select 'joe' name from dual union all
7 select 'Sam' name from dual
8 )
9 select name
10 from t
11 order by name
12 /
NAM
Joe
joe
max
Max
Sam
sam
6 rows selected.
SQL> with t as (
2 select 'Max' name from dual union all
3 select 'sam' name from dual union all
4 select 'Joe' name from dual union all
5 select 'max' name from dual union all
6 select 'joe' name from dual union all
7 select 'Sam' name from dual
8 )
9 select name
10 from t
11 where name = 'max'
12 /
NAM
Max
max
SQL> with t as (
2 select 'Max' name from dual union all
3 select 'sam' name from dual union all
4 select 'Joe' name from dual union all
5 select 'max' name from dual union all
6 select 'joe' name from dual union all
7 select 'Sam' name from dual
8 )
9 select name
10 from t
11 where name like 'm%'
12 /
NAM
max
SQL> select 'Max' name from dual union
2 select 'max' name from dual
3 /
NAM
Max
max
SQL> with t as (
2 select 'Max' name from dual union all
3 select 'sam' name from dual union all
4 select 'Joe' name from dual union all
5 select 'max' name from dual union all
6 select 'joe' name from dual union all
7 select 'Sam' name from dual
8 )
9 select distinct name
10 from t
11 /
NAM
sam
Joe
joe
max
Sam
Max
6 rows selected.
SQL> Starting 10g R2 NLS_COMP can be set to LINGUISTIC, which will also work for LIKE and UNION but not for DISTINCT:
SQL> alter session set nls_sort = binary_ci
2 /
Session altered.
SQL> alter session set nls_comp=linguistic
2 /
Session altered.
SQL> with t as (
2 select 'Max' name from dual union all
3 select 'sam' name from dual union all
4 select 'Joe' name from dual union all
5 select 'max' name from dual union all
6 select 'joe' name from dual union all
7 select 'Sam' name from dual
8 )
9 select name
10 from t
11 order by name
12 /
NAM
Joe
joe
max
Max
Sam
sam
6 rows selected.
SQL> with t as (
2 select 'Max' name from dual union all
3 select 'sam' name from dual union all
4 select 'Joe' name from dual union all
5 select 'max' name from dual union all
6 select 'joe' name from dual union all
7 select 'Sam' name from dual
8 )
9 select name
10 from t
11 where name = 'max'
12 /
NAM
Max
max
SQL> with t as (
2 select 'Max' name from dual union all
3 select 'sam' name from dual union all
4 select 'Joe' name from dual union all
5 select 'max' name from dual union all
6 select 'joe' name from dual union all
7 select 'Sam' name from dual
8 )
9 select name
10 from t
11 where name like 'm%'
12 /
NAM
Max
max
SQL> select 'Max' name from dual union
2 select 'max' name from dual
3 /
NAM
Max
SQL> with t as (
2 select 'Max' name from dual union all
3 select 'sam' name from dual union all
4 select 'Joe' name from dual union all
5 select 'max' name from dual union all
6 select 'joe' name from dual union all
7 select 'Sam' name from dual
8 )
9 select distinct name
10 from t
11 /
NAM
sam
Joe
joe
max
Sam
Max
6 rows selected.
SQL> However even LINGUISTIC does not work with:
• CLOB or NCLOB data types
• Object data types
• Table partitions
• Index-organized tables
SY. -
Search on text with diacritic, and case insensitive
Hello to all,
I'm using this condition in a query on XML:
field[contains(@value, "gangesa" )
If @value= 'Gaṅgeśa' I'd like to get this record also by using the word: "gangesa" So I need to map:
ṅ = n
ś = s
And do it in case insensitive. Somebody can help me?
Thank you,
CristianALTER SESSION SET NLS_COMP=LINGUISTIC;
ALTER session set nls_sort='binary_ai'; -->accent insensitive
binary_ci -->case insensitive.
with t as
(select 'Gageśa' col1 from dual union all
select 'GAgEśa' from dual union all
select 'gagEśA' from dual union all
select 'not Gageśa' from dual
select * from t where col1 like '%gagesa';
Gagesa
GAgEsa
gagEsA
not Gagesaand do the search.
Edited by: PhoenixBai on Aug 25, 2010 10:14 PM -
I have oracle 9.2.0.7 and I have a problem with the order that brings one to me query:
select * from aux to order by ape1, ape2
we have by exit:
ape1 ape2
alvarez campos
álvarez barros
nogueira canas
nogueira cañas
he orders well bad by the first field and by the second.
This happens if volume NLS_SORT = SPANISH And if volume NLS_SORT = GENERIC_BASELETTER orders well by the first field and badly by the second
ape1 ape2
álvarez barros
alvarez campos
nogueira cañas
nogueira canas
That solution I can adopt so that orders well by both fields
The serious correct order:
ape1 ape2
álvarez barros
alvarez campos
nogueira canas
nogueira cañas
The other variables NLS that I use are:
NLS_CALENDAR = GREGORIAN
NLS_CHARACTERSET = WE8ISO8859P1
NLS_COMP = BINARY
NLS_CURRENCY = ¿
NLS_DATE_FORMAT = DD/MM/RR
NLS_DATE_LANGUAGE = SPANISH
NLS_DUAL_CURRENCY = ¿
NLS_ISO_CURRENCY = SPAIN
NLS_LANGUAGE = SPANISH
NLS_LENGTH_SEMANTICS = BYTE
NLS_NCHAR_CHARACTERSET = AL16UTF16
NLS_NCHAR_CONV_EXCP = FALSE
NLS_NUMERIC_CHARACTERS = ,.
NLS_TERRITORY = SPAIN
NLS_TIME_FORMAT = HH24:MI:S SXFF
NLS_TIMESTAMP_FORMAT = DD/MM/RR HH24:MI:S SXFF
NLS_TIMESTAMP_TZ_FORMAT = DD/MM/RR HH24:MI:S SXFF TZR
NLS_TIME_TZ_FORMAT = HH24:MI:S SXFF TZR
Thanks.As far as I can tell, there are no NLS settings that would be guaranteed to generate your expected results because I cannot seem to find a sorting convention that orders data the way you want it to be ordered. As far as I can tell, you have specified a sort convention that applies only to you. It would be no different than if I decided that I wanted "a" to be sorted between "b" and "c"-- there would be no built-in sort system for this.
If you can identify the sort system you're trying to use (it's not modern Spanish or traditional Spanish, it's not case or accent insensitive, it's not binary), that may help us answer your question.
NLS_SORT of GENERIC_BASELETTER may sort your data the way you want because it ignores accents and tildes, but there is absolutely no guarantee of the order. If we're dealing with 4 rows of data, GENERIC_BASELETTER will (generally) return the data in whatever order it was inserted, so you could get the "right" result by changing the order of your INSERT statements. This, of course, would not be appropriate in a real system.
Justin -
Case insensitive searching in Interactive Page
Hi all,
I am currently working on the interactive report, and wondering is it possible to perform case insensitive search for the data in the textbox besides the magnifying class.
By the default, the system uses "=" for searching. I tried the searching option using "contains", and it would be able to search the content in uppercase and lower case scenario. Is it possible to make "contains" as the default?
Thanks,
Thomas.By the default, the system uses "=" for searching.I get "Row text contains..." as the filter when entering text directly into the default search box. Perhaps you are working with a saved report?
There's a way to make all IR comparisons case insensitive. See this <a ref="http://apex.oracle.com/pls/otn/f?p=34839:18">example of case/accent insensitive search</a> on a standard report.
That code can't be put in a Before Regions process as described to work with IRs as page processes are not executed by the AJAX call that refreshes the report. However, IR refreshes do run the Virtual Private Database PL/SQL call defined in the application security attributes, so putting the NLS modification code there will work.
Go to Application > Shared Components > Edit Security Attribute | Virtual Private Database (VPD), and make the call from there. Due to the specific requirements of the code that has to be called from here when used for security purposes, this is probably best done by setting this up to make separate calls to packages defined outside APEX, one to handle any actual VPD and other security-related details, and others to orchestrate any other code that has to be run. (For example, in this case it may not be desired to alter the NLS environment on every page, so the program could take a parameter specifying the current page and apply the ALTER SESSION conditionally on this.) -
How to enable AI(accent insensitiv) for one column without changing session
Following is my test SQL:
create table accent_test(col varchar2(10 char);
insert into accent_test values('INDIA');
insert into accent_test values('india');
insert into accent_test values('InDiÄ ');
Following SQL can only enable CI(Case insensitive), but can’t enable AI(accent insensitive):
select *
from accent_test
where NLS_UPPER(col, 'NLS_SORT=GENERIC_BASELETTER') LIKE NLS_UPPER('INDIA', 'NLS_SORT=GENERIC_BASELETTER')
COL
INDIA
india
Upper SQL can’t return the third row ‘InDiÄ’ which includes accent character.
I know following SQL can enable AI by changing the session. However it will change the whole session and other columns in one table:
SQL> ALTER SESSION SET NLS_COMP=LINGUISTIC;
SQL> ALTER SESSION SET NLS_SORT=GENERIC_BASELETTER;
Is there any solution to enable AI for only one column without changing the session?convert(<Any Chinese Character>, 'US7ASCII') will all return same character '?'.might be an matter of using the right characterset:
SQL> select 'ä' str, convert('ä', 'JA16SJIS') converted_str from dual union all
select 'á', convert('á', 'JA16SJIS') from dual union all
select 'â', convert('â', 'JA16SJIS') from dual union all
select 'à', convert('à', 'JA16SJIS') from dual
STR CONVERTED_STR
ä a
á a
â a
à a
4 rows selected. -
Linguistic index with LIKE + LOWER
Hi,
It seems that Oracle 11.2.0.1.0 is not able to use linguistic index when using the LIKE operator + LOWER function...
ALTER SESSION SET NLS_COMP='LINGUISTIC';
ALTER SESSION SET NLS_SORT='FRENCH_AI';
CREATE INDEX test_fai_idx
ON mytable(NLSSORT(LOWER(somefield), 'NLS_SORT=FRENCH_AI'));
SELECT *
FROM mytable
WHERE LOWER(somefield) LIKE 'gue%';
-- Table access FULL
DROP INDEX test_fai_idx;
ALTER SESSION SET NLS_COMP='BINARY';
CREATE INDEX test_bin_idx
ON mytable(LOWER(somefield));
SELECT *
FROM mytable
WHERE LOWER(somefield) LIKE 'gue%';
-- Index Range Scan
Questions:
-Will an upgrade to 11.2.0.2, 11.2.0.3 or 11.2.0.4 could solve that problem? (if anyone of you who have access to such a db and could make the test and report the result here, that will be much appreciated)
-Other ideas to help me?
I understand that using LOWER + AI seem strange since AI means accent-insensitive AND case-insensitive but, the software which run on the db use LOWER in all his SQL...
Thanks.
Paulocreate table test (nid number, name varchar2(30))
insert into test values(1, 'hügo')
ALTER SESSION SET NLS_COMP='LINGUISTIC';
ALTER SESSION SET NLS_SORT='FRENCH_AI';
select
from test
where
lower(name) like 'hug%'
no data found, full scan
create index idx_t on test(lower(name))
select
from test
where
lower(name) like 'hug%'
no data found, index range scan
drop index idx_t
create index idx_t on test(nlssort(lower(name), 'NLS_SORT=FRENCH_AI'))
select
from test
where
lower(name) like 'hug%'
no data found, full scan
Why should the index be used? You are looking for lower(name) but nlssort(lower(name), 'NLS_SORT=FRENCH_AI') indeed is something totally different:
select
nlssort(lower(name), 'NLS_SORT=FRENCH_AI') s
from test
S
3773325A000202020200
since
select
nlssort('hug', 'NLS_SORT=FRENCH_AI') s
from test
is
S
3773320002020200
you might recongize that it is not possible to do a like with nlssort.
Maybe you are looking for
-
I'm using a Audio Technica AT815ST stereo shotgun mic. It can be used in 3 modes MS, Stereo Narrow, and Stereo Wide. When capturing audio shot in MS mode into FCP the mid capsule comes in on audio track 1 and the side comes in combined, unmatrixed, o
-
Route TCPS01 is not maintained in route master
Hi Gurus, At VT01N level, I fail to understand what this message or error from the system means: "Route TCPS01 is not maintained in route master" Can anyone help me solve the problem? Thanks regards Chris
-
I have multiple folders in the root, let's call them A, B, C, D, E, etc. When I open any folder the B folder always opens. This means that for folders C, D, etc I have to scroll down past folder B to see the files. This problem started several weeks
-
Hi ,please i need some help i need to make this layout but i did not find how in the pivot table : Order status Orders count Paid A Confirmed B Cancelled C Rejecte D Alternative E Total Orders A+B+C+D+E=X Variance1 A/X Variance2 B/X Variance3 C/X Tot
-
HR Posting To accounting TcodeuFF1APcp0
Dear All, Now Iu2019ve a question about u201CPCP0u201D, I read the table u2018BKPFu2019 (Accounting Document), choosing the Fields of selection-Transaction Code = u201CPCP0u201D ,then run F8, and found a lot of documents posting from u201CPCP0u201D,