Case sensitivity in Oracle Text

I am familiar with the mixed_case parameter, and in my setup it is set to no, so all searches are case-insensitive. This is what I want 95% of the time, but is there a way to specify (at a query level) that a contains search is case sensitive?

Hi,
Would be nice, but the tokens are converted to uppercase on indexing. For example:
SQL> create table test (col1 varchar2(20));
Table created.
SQL> insert into test values ('MixEd cAsE');
1 row created.
SQL> create index test_idx on test(col1)
2 indextype is ctxsys.context;
Index created.
SQL> select token_text from dr$test_idx$i;
TOKEN_TEXT
CASE
MIXED
So, since they are actually stored/converted to uppercase there is nothing case-sensitive for your query to compare to.
On the flip side, if you index case-sensitive, the tokens are stored mixed-case.
SQL> drop index test_idx force;
Index dropped.
SQL> begin
2 ctx_ddl.create_preference('mylex', 'BASIC_LEXER');
3 ctx_ddl.set_attribute('mylex', 'mixed_case', 'yes');
4 end;
5 /
PL/SQL procedure successfully completed.
SQL> create index test_idx on test(col1)
2 indextype is ctxsys.context
3 parameters('lexer mylex');
Index created.
SQL> select token_text from dr$test_idx$i;
TOKEN_TEXT
MixEd
cAsE
Now you can do something with your query to make it do what you want. You'd have to check performance to see if it is worth it.
Ron

Similar Messages

  • Hibernate for lower case data(case sensitive) in oracle 10G

    Hi,
    I generated my data (oracle 10G release 2) using lowercase data types and table names. This requires queries in the strict form of -
    Select "Column_Name" from "Table_name";
    But Hibernate makes the queries as -
    Select Column_Name from Table_Name;
    driver I am using is oracle.jdbc.driver.OracleDriver
    Jar is ojdbc14
    and dialect is org.hibernate.dialect.Oracle9Dialect
    The problem is:
    table or view does not exist.
    as it(lower case data) does not recognize the hibernate query format.
    Can anyone suggest the proper driver and Jar to overcome the problem.
    Regards,
    Ankit

    Ankit,
    Just bite the bullet and don't use case-sensitive identifiers :-)
    I don't use "hibernate", but maybe you can add the double-quotes -- " -- in the XML file?
    I don't think there's a JDBC driver that adds the double-quotes for you. So I think your only option (if you insist on using case-sensistive identifiers) is to explore possibilities through "hibernate" itself.
    I also don't think there's any database setting that allows Oracle to accept case-sensitive identifiers.
    Good Luck,
    Avi.

  • CASE Sensitivity in Oracle

    Hi,
    I have a situation where I need to have the data in the Oracle 9 DB as case sensitive (which is the default setting in Oracle) ,but, I need to have case insensitive searches.
    Lets say I have data in a column like for example "apple". If the user enters "APPLE" or "Apple" or "apPLe", a match should be found.
    I am concerned at using the below trick because it can lead to a table scan when NLS_SORT is not binary.
    ALTER SESSION SET NLS_COMP=ANSI;
    ALTER SESSION SET NLS_SORT=GENERIC_BASELETTER;
    Thanks,
    Sridhar

    Like wise, you can also create a functional index (called Linguistic Index) in Oracle to support the cases when NLS_SORT <> Binary.
    For example:
    CREATE INDEX NLS_GENERIC_BASELETTER ON product
    (NLSSORT(product_name, 'NLS_SORT=GENERIC_BASELETTER'));

  • Case Sensitivity in Oracle 8i

    Does anyone know how to turn on and off Case Sensitivity?

    You can't.
    The only way to get round case-sensitivity is to ensure that the columns in question have an UPPER() or LOWER() applied, or to use interMedia ConText, which isn't case-sensitive.
    null

  • Case sensitive within character literals in SQL Server and Oracle

    I am migrating SQL Server database to Oracle database by using Oracle Workbench.
    SQL Server is not case sensitive, but Oracle PL/SQL is case sensitive within character literals. for example, if sort the following string ('UN','Win', 'iS' ,'Ne','zS'), SQL Server will get ('iS', 'Ne','UN','Win','zS') order, but Oracle PL/SQL will return ('Ne','UN','Win','iS','zS') order.
    Anyone has idea how I can get same result as SQL Server without change PL/SQL code (I don't want to change "ORDER BY typename" to "ORDER BY UPPER(typename)" for every stored procedure).
    Thanks

    Jimmy,
    alter session set NLS_SORT=West_European;
    is the closest thing I know of, but UPPER() is the only sure way.
    West_European sort order is AaBbCc ... 0123456789
    usually sort order is 0123456789 ABC ... abc ...

  • Case sensitivity for text fields

    Does anyone know how to turn off case sensitivity for a text field??
    Your help is appreciated.

    Do you recommend another field type that can be used that does not use case sensitivity?
    Thank you

  • Bugs due to case sensitivity of objects?!

    Hi,
    When migrating from MSAccess 97 to Oracle
    8i, it seems that there are many problems
    during the migration due to case sensitivity
    of Oracle objects. Specifically, the usage
    of the double quoted is not always correct
    resulting in JET/DAO 3011 messages. I dont
    know in which part of the chain is the
    problem though (Access, ODBC or Workbench).
    Is it possible, using Workbench wizard to
    create and reference all objects in a non-
    case sensitive manner (tablespace,
    tables ...) to avoid these problems.
    If not, any suggestion will be welcome,
    -Eric Giguere
    [email protected]
    null

    If you use SSO, then the passwords are case sensitive. If you are not using SSO, then you may need to create table that contains case sensitive passwords and associate them to database passwords.

  • Setting case sensitivity for text searches

    I am trying to figure out how to set case sensitivity for text searches for Oracle. I am using 8.1.7 and the documentation keeps referring me to the Basic_Lexer object. Does setting the mixed_case parameter to 'No' remove case sensitivity for the index or is there something else I need to do?

    Do you recommend another field type that can be used that does not use case sensitivity?
    Thank you

  • Is a Full Text Index search case sensitive or not in SQL Server 2012?

    I setup full text index on my contact table and am attempting to run a search on it using the following query:
    SELECT *
    FROM sysdba.Contact C
    WHERE CONTAINS(C.FirstName, 'Test')
    OR CONTAINS(C.LastName, 'Test')
    The problem is it's clearly running a case sensitive search. I did a quick search to find out how to change it to be case in-sensitive and found two pages (both for SQL Server 2012) with conflicting answers:
    1 - MSDN - "Query with Full-Text Search" - http://msdn.microsoft.com/en-us/library/ms142583(v=sql.110).aspx
    Case sensitivity
    Full-text search queries are case-insensitive. However, in Japanese, there are multiple phonetic orthographies in which the concept of orthographic normalization is akin to case insensitivity (for example, kana = insensitivity). This type of orthographic normalization
    is not supported.
    1 - TechNet - "Full-Text Search (SQL Server)" - http://technet.microsoft.com/en-us/library/ms142571(v=sql.110).aspx
    Full-text queries are
    not case-sensitive. For example, searching for "Aluminum" or "aluminum" returns the same results.
    Can someone please explain this? Is it possible to do it without it being case sensitive? If yes, how?
    (Sorry, I couldn't make those links b/c TechNet hasn't verified my account)
    Thank you for your time and help,
    Hanan

    Whats the collation setting for the columns? try using a case insensitive collation as below
    SELECT *
    FROM sysdba.Contact C
    WHERE CONTAINS(C.FirstName COLLATE SQL_Latin1_General_CP1_CI_AS, 'Test')
    OR CONTAINS(C.LastName COLLATE SQL_Latin1_General_CP1_CI_AS, 'Test')
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Problem in XI - JDBC (oracle) Scenario, case sensitive column name

    I had a XI -> JDBC scenario, connecting to a SQL server, where the query was being generated using Message Mapping (XML SQL Format),
    now the database has been migrated from SQL server to Oracle, and we are using the same XI scenario, but now the problem is, the query generated using message mapping doesnt work because it seems the query (UPDATE statement) requires the field name as having All capital letters, i mean the Column name in query to Oracle has become case sensitive,
    can u help me out

    Hi
    Oracle doesnt have restriction that Query has to be in uppercase for any column. But it is good go use Upper case for the Query.
    Use oracle editor to do the query if it is working fine and then use XML SQL in XI
    Check this thread SAP has given some
    http://help.sap.com/saphelp_nw04s/helpdata/en/43/68a541a1166153e10000000a1553f6/frameset.htm
    Check FAQ on the JDBC adapter, see SAP Note 831162
    always useful Note
    Thanks
    Gaurav

  • Oracle 11G password case sensitive option is not working.

    Hello,
    I am facing problem in Oracle 11G. I installed and created a database. I disabled password case sensitive option by setting it to false (Pls see the below output). but case sensitive option is not disabled and i am not able to logon using the lower case password.
    SQL> connect sys/<pwd in lower case>@<connect string> as sysdba;
    ERROR:
    ORA-01017: invalid username/password; logon denied
    Warning: You are no longer connected to ORACLE.
    SQL> connect sys/<pwd in uppper case>@<connect string> as sysdba;
    Connected.
    SQL> show parameter SEC_CASE_SENSITIVE_LOGON
    NAME TYPE VALUE
    sec_case_sensitive_logon boolean FALSE
    Any idea.... should i open the case in the metalink ?
    With Regards
    Hemant Joshi.

    Can you execute:
    SQL> select USERNAME, PASSWORD_VERSIONS from dba_users where username = 'SYS';Have you tried reseting the sys password? When you create the password file by default the passwords stored on it are case sensitive, maybe you also need to rebuild it...
    Enrique
    PS. See Note:429465.1 +11g R1 New Feature : Case Sensitive Passwords and Strong User Authentication+
    Edited by: Enrique Orbegozo on Oct 15, 2008 1:20 AM

  • Case-sensitive values in an Tabular Model with a Oracle Datasource

    Hi,Lets use an Oracle Database as Datasource for my Project. I use a "Select distinct ColumnA from Table" to build up a LookupTable in my Tabular Model. But it returns Dublicates!! eg:
    When I fire the query from Oracle SQL Developer I got 2 Records "1N" and "1n". In the Grid View in SSDT I see 2 times "1N". ??
    Collation Case Sensitive. OK, but how to solve that?
    KR

    Hi KR,
    According to your description, you encounter the case-sensitive issue when creating SQL Server Analysis Services Tabular model project, right?
    Based on my research, Tabular models have the insensitivity problem by default. The workaround for this issue is creating a empty tabular model in tabular server using the xmla below and import the tabular in SSDT.
    <Create xmlns="http://schemas.microsoft.com/analysisservices/2003/engine">
    <ObjectDefinition>
    <Database xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ddl2="http://schemas.microsoft.com/analysisservices/2003/engine/2" xmlns:ddl2_2="http://schemas.microsoft.com/analysisservices/2003/engine/2/2" xmlns:ddl100_100="http://schemas.microsoft.com/analysisservices/2008/engine/100/100" xmlns:ddl200="http://schemas.microsoft.com/analysisservices/2010/engine/200" xmlns:ddl200_200="http://schemas.microsoft.com/analysisservices/2010/engine/200/200" xmlns:ddl300="http://schemas.microsoft.com/analysisservices/2011/engine/300" xmlns:ddl300_300="http://schemas.microsoft.com/analysisservices/2011/engine/300/300">
    <ID>Collation test</ID>
    <Name>Collation test</Name>
    <Language>1033</Language>
    <Collation>Latin1_General_CS_AS</Collation>
    <DataSourceImpersonationInfo>
    <ImpersonationMode>Default</ImpersonationMode>
    </DataSourceImpersonationInfo>
    <ddl200_200:StorageEngineUsed>InMemory</ddl200_200:StorageEngineUsed>
    <ddl200:CompatibilityLevel>1100</ddl200:CompatibilityLevel>
    </Database>
    </ObjectDefinition>
    </Create>
    For the detail information about it, please refer to the link below.
    http://blogs.msdn.com/b/cathyk/archive/2011/10/24/making-tabular-models-more-sensitive.aspx
    Regards,
    Charlie Liao
    If you have any feedback on our support, please click
    here.
    Charlie Liao
    TechNet Community Support

  • Query Variable: F4 search by Text is case sensitive in Web Templates.

    Hello Guru's,
    I have a problem, when I am trying to search the variables in Web Templates the search by text is case sensitive.
    For example If I have the customer name as "King", I have to search the text as King or Ki*, But If I search as king I will not get any results.
    I need to have my text search as case insensitive.                                                                    
    When I checked in my BEx queries the search is case insensitive. I have the problem in my Web Templates only. Please let me know do I need to change any variable settings ing the web templates or let me know how do I fix this issue.
    Many Thanks,
    Vamshi Krishna

    Hi,
    So the only workaround for this would be to goto RSD1 -> enter info
    -object as xxxx, and press maintain, then goto master data/text
    tab and select the check box, 'with text', now save and activate the
    infoobject. After this regenerate the query using tcode rsrt.
    To regenerate goto rsrt enter query name and press 'generate report'
    button.
    Now the F4 help screen should show the options search by key and search
    by text. So that you can select serach by key to have a case insensitive
    search.
    Thanks,
    Venkat

  • Unable to create cache groups from CASE-SENSITIVE oracle table's name

    Hello All
    I have some case-sensitive tables in a oracle database and their columns are the same too. I've tried to cache these tables into TimesTen under a read-only cache group. I think timesten cannot find
    case-sensitive tables because as soon as I changed name of the tables, the creation could succeeded. What can I do to overcome this issue? I don't want lose case-sensitive feature. Is it because of
    I'm using an old version of TimesTen(11.2.1.4.0)

    Hi Chris
    Thanks for your answer. I'm using SQL Developer(both graphical and by command) to manage Timesten db. When I'm about to select root table for cache group i can see the table and when I
    select on it, the caching procedures can not be done and it says your table does not have Primary Key; you can see below that this is not true and the table has two primary key. When I'm
    trying to create the cache group via command in work sheet the error is "TT5140: could not find HLR.SUBSCRIBER. may not have privileges"
    in Oracle:
    CREATE TABLE "HLR"."Subscriber"
    "SSI" NUMBER(10,0) NOT NULL ENABLE,
    "CCNC" VARCHAR2(50 BYTE) NOT NULL ENABLE,
    "Code" VARCHAR2(128 BYTE) DEFAULT NULL NOT NULL ENABLE,
    "Account" NVARCHAR2(32),
    "Mnemonic" NVARCHAR2(15),
    "Region" NVARCHAR2(32),
    "UserAddress" NVARCHAR2(32),
    "Name" NVARCHAR2(32) NOT NULL ENABLE,
    "VPNCode" NUMBER(10,0),
    "VPNCCNC" VARCHAR2(50 BYTE),
    "SubOrgId" NUMBER(10,0),
    "SubscriberTypeId" NUMBER(2,0) DEFAULT 5 NOT NULL ENABLE,
    "StatusId" NUMBER(2,0) DEFAULT 1 NOT NULL ENABLE,
    "SubscriberClass" NUMBER(2,0),
    "DefinedIpAddressId" NUMBER(10,0),
    CONSTRAINT "Subscriber_PK" PRIMARY KEY ("SSI", "CCNC") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 COMPUTE STATISTICS STORAGE(INITIAL 65536 NEXT 1048576 MINEXTENTS 1 MAXEXTENTS 2147483645 PCTINCREASE 0 FREELISTS 1 FREELIST GROUPS 1 BUFFER_POOL DEFAULT FLASH_CACHE DEFAULT CELL_FLASH_CACHE DEFAULT) TABLESPACE "USERS" ENABLE,
    CONSTRAINT "FK_DefinedIpAdd_Subscriber" FOREIGN KEY ("DefinedIpAddressId") REFERENCES "HLR"."DefinedIPAddress" ("Id") ENABLE,
    CONSTRAINT "Fk_Status_Subscriber" FOREIGN KEY ("StatusId") REFERENCES "HLR"."Status" ("Id") ENABLE,
    CONSTRAINT "Fk_SubOrg_Subscriber" FOREIGN KEY ("SubOrgId") REFERENCES "HLR"."SubOrganization" ("Id") ENABLE,
    CONSTRAINT "Fk_SubscriberType_Subscriber" FOREIGN KEY ("SubscriberTypeId") REFERENCES "HLR"."SubscriberType" ("Id") ENABLE,
    CONSTRAINT "Fk_VPN_Subscriber" FOREIGN KEY ("VPNCode", "VPNCCNC") REFERENCES "HLR"."VPN" ("SSI", "CCNC") ENABLE
    in TimesTen:
    CREATE READONLY CACHE GROUP "PRO1"
    AUTOREFRESH MODE INCREMENTAL INTERVAL 5 MINUTES
    STATE PAUSED
    FROM "HLR"."Subscriber"
    "SSI" NUMBER(10,0) NOT NULL ,
    "CCNC" VARCHAR2(50 BYTE) NOT NULL ,
    "Code" VARCHAR2(128 BYTE) NOT NULL ,
    "Account" NVARCHAR2(32),
    "Mnemonic" NVARCHAR2(15),
    "Region" NVARCHAR2(32),
    "UserAddress" NVARCHAR2(32),
    "Name" NVARCHAR2(32) NOT NULL ,
    "VPNCode" NUMBER(10,0),
    "VPNCCNC" VARCHAR2(50 BYTE),
    "SubOrgId" NUMBER(10,0),
    "SubscriberTypeId" NUMBER(2,0) DEFAULT 5 NOT NULL ,
    "StatusId" NUMBER(2,0) DEFAULT 1 NOT NULL ,
    "SubscriberClass" NUMBER(2,0),
    "DefinedIpAddressId" NUMBER(10,0),
    PRIMARY KEY("CCNC","SSI")
    )

  • Oracle 9 table names are not case sensitive

    Sorry about the trivial question, but I noticed that when I am creating table in Oracle their names is always upper case.
    Example:
    CREATE TABLE MyTable (i NUMBER(5))
    CREATE TABLE MYTable (i NUMBER(5))
    CREATE TABLE MyTABLE (i NUMBER(5))
    CREATE TABLE MyTablE (i NUMBER(5))
    it is the same table. Is it true that Oracle cannot create tables with names case sensitive, or I am doing something wrong.
    Any help

    You can create case sensitive table with table names enclosed in quotes.
    SQL> create table sample(id number);
    Table created.
    SQL> select table_name from user_tables where upper(table_name)='SAMPLE';
    TABLE_NAME
    SAMPLE
    SQL> create table "sample"(id number);
    Table created.
    SQL> select table_name from user_tables where upper(table_name)='SAMPLE';
    TABLE_NAME
    SAMPLE
    sample
    SQL>

Maybe you are looking for

  • Do not display microsd photo on xperia library.

    Hello to all I just have adquired a xperia Z2 and my problem is I have lots of photos in my microsd card(which comes form my old xperia Z1) but it does not display on xperia Z2 library.I have to install other app as  .apk as quickpic to view. Any sol

  • My BB 9300 is eating my prepaid credits

    hi, i dont know why but it seems that my bb is auto connect to browse without my permission, coz its eating my prepaid credits. i called my mobile network provider and they told me that i got a lot of brwosing activities which is not true as far as i

  • TDS TABLE Not updating

    Hi Experts, I m using TDS 4.9 version whenever i do A/P invoice the WH(TDS ) calculation is doing good but the related table @CXS_TDS_ENTRY is not updating Plz suggest me Rajesh B K

  • Class /SAPSRM/CL_WF_PROCESS_LEVEL method IS_LAST_LEVEL not working

    We are running SRM 7.0 SP 8 with Process Controlled Workflow. I am trying to use object with reference to class /SAPSRM/CL_WF_PROCESS_LEVEL, method IS_LAST_LEVEL to determine if the current workflow process level is the last in an N-step approval. Bu

  • ITunes apps icons do not appear correctly

    iOs apps icons in iTunes looks strange, it was from the very beginning when I bought a MPBr. Any idea how to fix it? Selected app