Case insensitive XPATH

Hi,
I have the following XMLs stored in a column.
<root>
<abc>abc</abc>
<def>def</def>
</root>
<root>
<ABC>abc</ABC>
<DEF>def</DEF>
</root>
Is there someway to use a case insensitive search in my extractValue so that I don't have to write it twice?
extractValue (XML_CLOB, /root/abc)
extractValue (XML_CLOB, /root/ABC)
Thanks and Regards,
A

chrisis wrote:
Thought upper-case(name()) = "ABC" should work, but it doesn't seem to on 10.2Yes, fn:upper-case (and fn:lower-case) are XPath 2.0, EXTRACT and EXTRACTVALUE only implement XPath 1.0.
It will work with XQuery though, which includes XPath 2.0 :
WITH t AS (
  SELECT xmltype(
   '<root><ABC>abc</ABC><DEF>def</DEF></root>'
  ) doc
  FROM dual
SELECT xmlquery(
'root/*[fn:lower-case(name())="abc"]/text()'
passing by value t.doc
returning content
).getStringVal()
FROM t;

Similar Messages

  • Possible to do case-insensitive searches?

    G'day,
    I was wondering if it's possible to do case-insensitive searches in oracle/HTMLDB?
    I've tried what I thought would work
    "select * from application where name like '%microsoft%'", this unfortunately doesn't return any records with a capital in it(eg "Microsoft").
    If there is no way to do case-insensitive searches what is the best way around it?
    Thanks
    -Colin

    Colin,
    Yes it is possible to do case insensitive searches using SQL. Try, for example:
    select * from application where upper(name) like '%ORACLE%'
    The trick is to upper() both sides of the like operator.
    Sergio

  • Error in a report after enabling case insensitive search in conn pool prop

    Hi All,
    I put the below code in connection pool's connection string to enable case insensitive search.
    alter session set NLS_SORT=BINARY_CI
    alter session set NLS_COMP=LINGUISTIC
    After putting this code one of my report started giving the below error which was working fine otherwise.
    Error Codes: OPR4ONWY:U9IM8TAC:OI2DL65P
    State: HY000. Code: 10058. NQODBC SQL_STATE: HY000 nQSError: 10058 A general error has occurred. nQSError: 16001 ODBC error state: S1000 code: 1791 message: OracleODBCOraORA-01791: not a SELECTed expression. nQSError: 16001 ODBC error state: S1000 code: 1791 message: OracleODBCOraORA-01791: not a SELECTed expression. nQSError: 16015 SQL statement execution failed. (HY000)
    The report gives error for the below divide condition when I select a column from a different dimension (eg: region)
    COUNT(DISTINCT RMA.RMA)/COUNT(DISTINCT User."User Name")
    Can anyone please throw a light why this is happening.

    Below is the SQL which is throwing error in OBIEE. It was working fine when I tried running it in toad:
    select T1609.ATTRIB_05 as c1,
    count(distinct T1609.ATTRIB_42) as c2,
    TRUNC(T1159.FSCL_WEEK_START_DT) as c3
    from
    WC_DAY_D T1159 /* RMA_RECEIVED_DT(WC_DAY_D) */ ,
    WC_RMA_D T571,
    WC_FV_FA_D T1609,
    WC_FV_FA_F T1679
    where ( T571.ROW_WID = T1679.RMA_WID and T1159.ROW_WID = T1679.RMA_RECEIVED_WID and T1609.ROW_WID = T1679.FV_FA_WID and T1609.ATTRIB_39 <> 'FV' and (T571.STATUS_CD in ('2nd FA', '2nd FA Review', 'Closed')) and TRUNC(T1609.TODO_ACTL_END_DT) is not null and TRUNC(T1159.FSCL_WEEK_START_DT) between TIMESTAMP '2009-03-22 00:00:00' and TIMESTAMP '2009-04-12 00:00:00' )
    group by T1609.ATTRIB_05, TRUNC(T1159.FSCL_WEEK_START_DT)
    order by c3
    -------------------- Query Status: Query Failed: [nQSError: 16001] ODBC error state: S1000 code: 1791 message: [Oracle][ODBC][Ora]ORA-01791: not a SELECTed expression.
    [nQSError: 16001] ODBC error state: S1000 code: 1791 message: [Oracle][ODBC][Ora]ORA-01791: not a SELECTed expression.
    [nQSError: 16015] SQL statement execution failed.

  • How to change Database server is case-insensitive setting at runtime

    Is there a way to change any of the properties in Report Options > General Settings at runtime. Mainly the [Database server is case-insensitive] and [Perform grouping on server] settings. We are using the Crystal .Net X1 runtimes (11.5.9707.811). I have sesrched the forums with no luck so thought I'd try my luck here. Thankyou for your time.

    Hi Simon,
    Sorry, search for the function using the Object Browser in .NET. If you have Crsytal Reports XI R2 (11.5.x.xxxx) then you have it. Unless it's not a developer version. In whcih case you need to upgrade.
    If you do have the Developer version then simply add the RAS assemblies to your project. Look in our samples above for more info on h ow to use RAS.
    If you don't have the Developer version then your only options are to upgrade or manually change the report settings in the Designer.
    Thank you
    Don

  • How do I move my large iTunes collection from a case-sensitive hard drive to a case-insensitive hard drive?

    I currently keep my iTunes media on an external hard drive because it takes up too much space on my machine. I recently discovered that it was formatted as case-sensitive when I bought it, and now months later I'm having issues. When attempting to back up my files on a case-insensitive hard drive, the operation failed due to conflicting file/folder names (Artist and artist are now considered the same file name and one would have to overwrite the other). I now have a large iTunes file collection that is stuck on the case-sensitive hard drive, and I want to save a backup on a case-insensitive drive. 
    Is there a way to identify all cases where multiple files/folders have the same title/album/artist but different spelling so there will be no conflicts? The folder/file names would have to be crossed referenced to highlight any cases where File/fiLe/file  would cause a problem.
    I imagine there is a way to do this using iTunes script or Automator  or a command in terminal or something rather than going through and checking/fixing all the information for thousands of songs by hand. I'm at the limits of my minimal development skills, so any help would be appreciated.

    You should be able to use either "Carbon Copy Cloner" or "SuperDuper" (free for this purpose) to copy your case-sensitive volume to an empty case-insensitive one. Make at least two such copies on different drives. One is not enough to be safe.
    If there are any name conflicts—that is, files in the same folder with names that differ only in case, such as "File" and "file"—then you will either get an error or one of the files won't be copied. You must ensure either that no such conflicts exist, or that the consequences are not important. How you do that is up to you. Unless you went out of your way to create conflicts, they probably don't exist.
    Then erase the source volume in Disk Utility as case-insensitive. This action will remove all data from the volume.
    Restore from one of your backups using the same application you used to create it, or use the "Restore" feature of Disk Utility, which will be faster. Search its built-in help for the term "duplicate" if you need instructions.

  • Time Machine says both of my external hard drives require reformatting to case insensitive. What do I do?

    I have been successfuly using Time Machine to back my iMac  to an external hard drive (via usb) and everything has been fine for the last year. I have been using TM to back up to a HD called Terra LaCie via usb.
    A week ago, my iMac hard drive was full--so I spulrged and bought a 6 TB external hard drive (Western Digital My Book-Thunderbolt). I set up the new Thunderbold HD to use RAID 1 (mirror) and copied most of my iMac hard drive over to the Thunderbolt HD.
    I kept my working photographs (most recent) on my iMac and felt good to know my older photographs are on my new Thunderbolt hard drive.
    For a few days, Time Machine seemed to work fine (backing up my iMac to Terra LaCie HD. I haven't been concerned with backing up the Thunderbolt drive (as I feel that mirroring is same as backing up).
    Yesterday, Time Machine indicated the lastest back-up failed (for the HD called Terra LaCie). Now, when I go into Time Machine, the dialog box indicates the following message:
    "Are you sure you want to erase the backup disk “Terra Lacie”? Erasing will destroy all information on the disk and can’t be undone.
    The disk must be erased before it can be used for Time Machine backups because a disk you are backing up is case sensitive, but the backup disk is not."
    When I open Time Machine to look at my external hard drives (I also have a third usb portable drive); two of the three drives indicate the following:
    "reformat required; case insensitive disk".
    The small, portable hard drive (that I'm also using) doesn't say it needs to be reformated (but my new Thunderbolt and my old usb HD both indicate the same message (above).
    What should I do? I just spent days transferring my photographs from my iMac to my new Thunderbolt. Should I just not use Time Machine any longer and work from my Thunderbolt drive?
    Am I to understand that my iMac suddenly become case sensitive? Sorry if this was too much information about my hard-ware set-up.
    Any help someone can provide me would be greatly appreciated. I suppose I need to understand Time Machine and perhaps my Thunderbolt better.

    Hi BDAqua,
    Bravo, you helped me solve my problem.
    The Case Sensitive Disk was the small portable hard drive that I was using termporarily.
    I just disconnected it and I started TM machine and everything seems to be working just fine.
    Thank you very much!!!!

  • How do I convert a case sensitive drive to a case insensitive drive?

    I have recently purchased a MacMini Server, and installed the 2 internal hard drives in a RAID 0 configuration to obtain the speed and 1 TB capacity, but unfortunately (rather stupidly in retrospect) formatted the drive in case sensitive mode.
    On installing the operating system and multiple applications, everything seemed to work well until I tried to install Adobe Acrobat X Pro. This application refuses to install on a case sensitive formatted drive, which I now understand is a common problem.
    The question is how can I convert to a case insensitive format without reinstalling all of the software from scratch?
    I have a Time Machine backup, and the easiest thing for me would be to reformat the drive, and then restore from the Time Machine backup.
    Will this process work? Or will there be some complications and files that will not function if they were originally installed on a case sensitive drive?
    Any help is appreciated....

    iPartition can do it ( http://www.coriolis-systems.com/iPartition.php ).
    from iPartition Help:
    Make Case Sensitive/Case Insensitive
    HFS+ now supports a case sensitive format as well as the usual case insensitive format. On a case sensitive volume, the names “Readme”, “README” and “ReadMe” would all represent different files, even if they were in the same folder.
    This option allows you to non-destructively change a case sensitive volume into a case insensitive one, and vice-versa. If you are going from a case sensitive volume to a case insensitive volume, some of your files may be renamed automatically by iPartition so that they do not clash. If all of the files in the table below were in the same directory, the right hand column shows the new names iPartition would choose for them:
    Old name New name
    README.txt README.txt
    ReadMe.txt ReadMe 1.txt
    Readme.txt Readme 2.txt
    README README
    ReadMe ReadMe 1
    Readme Readme 2
    Notice that iPartition puts the number before any file extension.
    N.B. iPartition does not transform filenames with numbers on the end back into their original forms. There is no way to tell which files were renamed by the user and which were renamed by the conversion process.

  • Case-Insensitive File Name Search on Unix

    Hello,
    I have a program which runs on a Unix OS and it looks for some files like file.csv, and then reads these files. Basically I know the file name and I look for that file name in a particular directory.
    Now, I want to make my program case-insensitive so that if the file name is file.csv or File.csv or FILE.csv, it should still locate that file and read it.
    Any advice....
    Thanks.

    Thanks.
    Probably I have to get all the file names in that
    directory and then try to match against the file name
    (using ignore case or toUpperCase() maybe), which I
    am looking for.
    Is there a way, where I don't have to get all the
    file names in that directory and can just go and get
    the FileReader Object etc for the file which I am
    looking for.No
    /Kaj

  • Specifying Case-Insensitive Element Names in XML Schema

    Hope someone knows this!
    Is it possible to define an an XML Schema Definition so that Element names in the target XML File can be case insensitive.
    At the moment my Parser throws an error if the element names in the XML file do not have the exact same case as the definition in the XML schema.
    E.g
    In Schema i have:
    <xsd:element name="HOSTINVENTORYLINE" type="HostInventoryLineType" maxOccurs="unbounded" minOccurs="0"/>
    but in xml file i have
    <HostInventoryLine field=""/>
    or
    <hostinventoryline field=""/>
    Does anyone know anyway to get around this, so that the parser accepts the HostInventoryLine element in the xml as an instance of the HOSTINVENTORYLINE element defined in the schema.
    Thanks in Advance
    JJ
    Message was edited by:
    [email protected]

    You could use substitution groups to handle this. You would need an entry in the schema for each valid capitalization. This won't scale well if you want to be completely case insensitive, but if you only support lower case, upper case, and camel case it should do the trick.
    <?xml version="1.0" encoding="UTF-8"?>
    <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">
         <xs:complexType name="HostInventoryLineType">
              <xs:sequence>
                   <xs:element name="an-element" type="xs:string"/>
              </xs:sequence>
         </xs:complexType>
         <xs:element name="HostInventoryLine" type="HostInventoryLineType"/>
         <xs:element name="HOSTINVENTORYLINE" type="HostInventoryLineType" substitutionGroup="HostInventoryLine"/>
         <xs:element name="hostinventoryline" type="HostInventoryLineType" substitutionGroup="HostInventoryLine"/>
    </xs:schema>-Blaise

  • How can I copy media from an HFS case-sensitive drive to an HFS case-insensitive drive without getting an error?

    About a year ago, I accidentally created a partition on my drive for my iTunes Music. On that parition, called MUSIC, I selected the filesystem to be an HFS, Journaled, case-sensitive partition. Since then, all of my music, new and old, lives on the case-sensitive MUSIC parition.
    My other partition, called BOX, is an HFS, Journaled, case-insensitive filesystem, as are my external drives I use for archiving and backing up my music.
    My dilemma: when I try to copy my music/iTunes media from the MUSIC partition to a different partition that's case-insensitive, I obviously run into errors saying that certain files can't be copied because they will overwrite others. Subsequently, I can't back up my music and iTunes media to another drive unless it has the same filesystem parameters favoring case-sensitivity. I want to move my media to a case-insenstive drive/partition.
    As the story goes, I'd like to avoid having to reformat and worry about moving my media around because I feel, in the end, I'd end up doing more harm then good in my pursuit to fix this issue.
    My question: is there some way I can detect which files are conflicting with each other, and then manually rename them? My music library runs about 16,000 songs deep, but I'd still feel saved even if I had to go through and manually rename all of the music files so they don't conflict with each other in order to get them on to a case-insensitive drive. Perhaps there's an AppleScript someone knows about that I could execute in my MUSIC partition to see which files/directories are causing my problems? In other words, I'm thinking there could be a way to detect the same file/directory names that are only different soley because of their case.
    Any help, suggestions, or solutions are welcome. Thank you all for your time in helping me solve this!
    And have a Happy Thanksgiving

    How do I restore a case-sensitive,...: Apple Support Communities

  • SELECT Query to get the Values in Case insensitive Format

    Hi ,
    This is hari,
    I want to select the user name in a table ex: username="HARI" or username='Hari' or username="HaRi" like this
    If i wrote the query like
    select username from userdb where username="Hari";
    it is displaying the records which only matches "Hari" only .
    can anybody help me out on this query asap please....
    the query should return all the results
    which matches any of the following strings as inputs "HARI" or "HaRi" or "hAri" or the like.
    Awaiting for Response,
    Thanks & Regards
    Hari

    Another solution is setting NLS_SORT to CI - case insensitive (or whatever_your_language_is_CI) and NLS_COMP to ANSI:
    SQL> with t as (
      2             select 'HARI' name from dual union all
      3             select 'Hari' name from dual union all
      4             select 'HaRi' name from dual
      5            )
      6  select  *
      7    from  t
      8    where name = 'hArI'
      9  /
    no rows selected
    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 'HARI' name from dual union all
      3             select 'Hari' name from dual union all
      4             select 'HaRi' name from dual
      5            )
      6  select  *
      7    from  t
      8    where name = 'hArI'
      9  /
    NAME
    HARI
    Hari
    HaRi
    SQL> SY.

  • Case-insensitive -- what's a scriptor to do?

    Here's my delima: (from a tcsh)
    % ls
    file1.txt file2.TXT file3.txt
    % ls file{1,2,3}.TXT
    file1.TXT file2.TXT file3.TXT
    % ls *.TXT
    file2.TXT
    % rm *.txt
    I've written hundreds of unix (csh,tcsh, perl) scripts since around 1988. I never considered that some day UNIX would ignore case in filenames.
    As you can imagine, I'm going to have to re-write dozens of scripts, now that I have this case-insensitive "feature".
    QUESTION 1: Is there some way to turn off the ignore-case in Apple unix? What are the consequences of such a bold act?
    QUESTION 2: Is there a simple variable, switch, or something, that tells the shell (tcsh) that files are case-sensitive (e.g. *.TXT would match *.txt)? Same request goes for telling filec that is should ignore case.
    PowerBook G4   Mac OS X (10.3.9)  

    Hi Bill,
       I see what you're saying. When the shell passes information to the filesystem, case ceases to matter. However, C Webber is talking about the reverse situation. HFS+ is case-insensitive but it is case-preserving. Whatever case is used in the naming of a file is reproduced faithfully in read operations and shells are by default case-sensitive. C Webber's example was filename globbing. The shell reads the names of the files and looks for matches in a case-sensitive fashion. In that case, case will matter.
       I can see where this would cause problems. You might test for the existence of a file in a case-sensitive fashion, find out that it doesn't, write to the filesystem and blow away a file even though you were careful. You know that something like that happened with the Perl install script, causing it to blow away dozens of its own man pages.
    C. Webber,
       I did a search of the tcsh man page and found nothing suggesting that you can turn off case-sensitivity in globbing. You can do so in completion but it appears that rewrites will be necessary. I encourage you to view this as an opportunity and switch to a more powerful shell. I agree with you that this issue is unique to Mac OS X but every flavor of UNIX has its own issues. We've all had to make changes to migrate scripts. I've certainly had to do that to migrate some of my scripts to Linux and some won't migrate at all. (I use AppleScript in many of my scripts)
    Gary
    ~~~~
       "The glory of creation is in its infinite diversity."
       "And in the way our differences combine to create meaning and beauty."
             -- Dr. Miranda Jones and Spock, "Is There in Truth No Beauty?",
                stardate 5630.8

  • How to make a sortable column in a table to do a case insensitive sort ?

    Hi :
    I am using Jdeveloper Studio Edition Version 11.1.1.1.0 and my table columns are sortable but i want to make sure that it case insensitive sort ,for example if i have following column values :
    abc,def,ABC,ghi
    Sorted results should not be likes this : abc,def,ghi,ABC
    instead of this it should be like this : abc,ABC,def,ghi
    Please let me know more about it.
    Thanks
    AN

    Dear,
    I'm using the same configuration, Could u tell me how did u done the sort in a column in any case.
    Regards,
    RengarajR
    Edited by: Rengaraj Rengasamy on Oct 19, 2009 1:34 AM

  • Mapping with case insensitivity in Filter operator expression

    I need to import data from an ODS into DW table.
    How can I set this before a certain mapping is run to make it case insensitive?
    execute immediate 'alter session set NLS_SORT=BINARY_CI';
    execute immediate 'alter session set NLS_COMP=LINGUISTIC';
    Thanks,
    JGP

    Hi,
    Use upper(column) in the filter expression.
    Regards
    Bharath

  • Case Insensitive Indexes

    In relation to switching on case insensitive queries using
    alter session set NLS_COMP=LINGUISTIC;Can anyone answer the following?
    >
    Yes, it works.... but I can't for the life of me figure out how to build a linguistic index that the LIKE clause will actually use. Building an index thus, for example:
    create index bin_ai on names(NLSSORT("NAME",'nls_sort=''BINARY_AI'''));
    makes an index which does get used to good effect by queries such as
    select name from names where name = 'Johny Jacobson';
    but not by
    select name from names where name like 'Johny%';
    Hence, in a real-world test with 100,000 records, the LIKE query runs about 100 times slower than the '=' query (3 sec compared to 0.03 sec). Not very scalable. Is there a way to speed this up??
    Also is it possible to set session variables such as nls_comp on a database/schema/user level?

    Hi,
    select name from names where name like 'Johny%';Performance when using the SQL "like" clause can be tricky because the wildcard "%" operator can invalidate the index. For example a last_name index would be OK with a "like 'SMI%'" query, but unusable with "like '%SMI%'.
    One obscure trick for indexing queries "like '%SON'" is to create a REVERSE index and them programmatically reverse the like clause to read "like 'NOS%'", effectively indexing on the other side of the text.
    You might want to look at Oracle*text indexes, if your database has low DML:
    http://www.dba-oracle.com/oracle_tips_like_sql_index.htm
    If you are 10gr2:
    Oracle 10g release 2 has now introduced a case insensitive search method for SQL that avoids index invalidation and unnecessary full-table scans. You can also employ Oracle text indexes to remove full-table scans when using the LIKE operator. Prior to Oracle10g release 2 case insensitive queries required special planning:
    1 - Transform data in the query to make it case insensitive (note that this can invalidate indexes without a function-based index):
    create index upper_full_name on customer ( upper(full_name));
    select full_name from customer
    where upper(full_name) = 'DON BURLESON';
    2 - Use a trigger to transform the data to make it case insensitive (or store the data with the to_lower or to_upper BIF.
    3 - Use Alter session commands:
    alter session set NLS_COMP=ANSI;
    alter session set NLS_SORT=GENERIC_BASELETTER;
    select * from customer where full_name = 'Don Burleson'
    Hope this helps. . .
    Don Burleson
    Oracle Press author

Maybe you are looking for

  • Free Goods Promotions for Retail.

    Hi SAP Retail Xperts. Actually I am working with Promotions for retail industry, and I am using the transaction WAK1, in order to create them. Our client, work with free goods (exclusive bonus quantity) and I can see that the WAK1 transaction has a v

  • How do i get music on my new ipad

    I do not know how to play music on my new ipad nor do I know how to load music on it

  • Short delivery report

    Gurus, Any standard report to show short delivery? Example: Sales Order 100 Qty, Delivery 50 Qty. Example: Sales Order 100 Qty, Delivery 50 Qty, Pick Qty : 25 Example: Sales Order 100 Qty, Delivery 50 Qty, Pick Qty : 25, PGI Qty : 10

  • Help with 6th Gen iPod Nano please

    Hello, I have a 6th gen ipod nano currently for about 1 and a half years, which has been working fine as of late, but today it lost all battery completely (I had used it for the first time yesterday paired up with the Nike+ attachment). Not knowing t

  • Can't update E61 (prod code 0538289) to firmware v...

    Hi, I've been trying to update my E61 phone (prod code 0538289) to the latest v3 firmware build for over 3 weeks now. The phone came factory flashed with firmware v2 and would like to take advantage of the enhanced SIP capabilities present in v3. At