<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Is there an option in Oracle that will return the data in upper or lower case ? in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027990#M910129</link>
    <description>Hi Hendrique&lt;BR /&gt;&lt;BR /&gt;All the given answers work fine but be aware of one improtant thing :&lt;BR /&gt;Using functions (Like upper or lower) in views and/or select statements can impact the time needed to retrieve the data out of ORACLE as it may be that ORACLE is not able to use indexes on data which has been transformed by a function. As far as i know it must be ORACLE 9 or at least 8i to use indexes also on functions.&lt;BR /&gt;This means if the username in your db is indexed and you select it by using a function then you will end up with a full table scan. This does not matter if there just a few rows in the table., but generally it can be a problem. ( I learned it the hard way with big tables).</description>
    <pubDate>Mon, 21 Jul 2003 05:23:36 GMT</pubDate>
    <dc:creator>Reinhard Burger</dc:creator>
    <dc:date>2003-07-21T05:23:36Z</dc:date>
    <item>
      <title>Is there an option in Oracle that will return the data in upper or lower case ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027986#M910125</link>
      <description>&lt;BR /&gt;     I have no access to the query itself, just to the data.&lt;BR /&gt;&lt;BR /&gt;      This app has to authenticate users based on their emails, however, some emails were entered manually while others automatically, and instead of using SEA, some emails look like this :&lt;BR /&gt;&lt;BR /&gt;Joe.Doe@domain.com    while others  look like&lt;BR /&gt;joe.doe@domain.com&lt;BR /&gt;&lt;BR /&gt;     NOW, here is my problem.&lt;BR /&gt;&lt;BR /&gt;     I would like to be able to authenticate the users by having returned data being either upper or lower case.   Is there a global option that will do that. &lt;BR /&gt;&lt;BR /&gt;     NOW,  the conundrum here is that if this is a global option, then ALL my data for all other apps will be returned upper or lower case also, and that is not acceptable.&lt;BR /&gt;&lt;BR /&gt;     So, how can I achieve this without having to go to the app owner that needs this to simply add a function on his query toupper() or tolower() to compare the entries ?  This will require code modification and we do not own the code.  They do not have the same problem with Sql Server.  It seems to work there, but I think it is because sqlserver is NOT case sensitive as Oracle is.  Am I wrong here ?&lt;BR /&gt;&lt;BR /&gt;     ALso, is there even such an option on oracle to do this ?  Is there an option to do this ONLY FOR A SESSION ?  That would seem to cure the problem, for we could do it only for that particular schema !!!!!&lt;BR /&gt;&lt;BR /&gt;      Anyways,   please help me understand my options so that I can pass it along to the app owner here !!!&lt;BR /&gt;&lt;BR /&gt;       Thanks,&lt;BR /&gt;&lt;BR /&gt;Henrique&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sat, 19 Jul 2003 13:32:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027986#M910125</guid>
      <dc:creator>Henrique Silva_3</dc:creator>
      <dc:date>2003-07-19T13:32:51Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option in Oracle that will return the data in upper or lower case ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027987#M910126</link>
      <description>Henrique,&lt;BR /&gt;&lt;BR /&gt;You could do something like the following:&lt;BR /&gt;&lt;BR /&gt;select * from contact where upper(email) = upper(:1);&lt;BR /&gt;&lt;BR /&gt;That should make your application do the work.  "lower" would work as well.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;&lt;BR /&gt;Brian</description>
      <pubDate>Sun, 20 Jul 2003 00:10:08 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027987#M910126</guid>
      <dc:creator>Brian Crabtree</dc:creator>
      <dc:date>2003-07-20T00:10:08Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option in Oracle that will return the data in upper or lower case ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027988#M910127</link>
      <description>Hello Henrique,&lt;BR /&gt;&lt;BR /&gt;how about build a "view" for those queries where you need everything in upper or lower case?&lt;BR /&gt;And the view is basically just a simple "select", but with "lower()" resp. "upper()" on those columns...&lt;BR /&gt;Then your data tables can stay as they are.&lt;BR /&gt;&lt;BR /&gt;FWIW,&lt;BR /&gt;Wodisch</description>
      <pubDate>Sun, 20 Jul 2003 16:19:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027988#M910127</guid>
      <dc:creator>Wodisch</dc:creator>
      <dc:date>2003-07-20T16:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option in Oracle that will return the data in upper or lower case ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027989#M910128</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;A view should solve the "problem".&lt;BR /&gt;&lt;BR /&gt;If you want it for a particular user, you can create the view "locally" for the user so that it takes precedence however this depends on the application design (is using public synonyms, etc).&lt;BR /&gt;&lt;BR /&gt;you can also rename the table and create the view with the same name.&lt;BR /&gt;&lt;BR /&gt;hope this helps!&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Sun, 20 Jul 2003 17:24:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027989#M910128</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2003-07-20T17:24:01Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option in Oracle that will return the data in upper or lower case ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027990#M910129</link>
      <description>Hi Hendrique&lt;BR /&gt;&lt;BR /&gt;All the given answers work fine but be aware of one improtant thing :&lt;BR /&gt;Using functions (Like upper or lower) in views and/or select statements can impact the time needed to retrieve the data out of ORACLE as it may be that ORACLE is not able to use indexes on data which has been transformed by a function. As far as i know it must be ORACLE 9 or at least 8i to use indexes also on functions.&lt;BR /&gt;This means if the username in your db is indexed and you select it by using a function then you will end up with a full table scan. This does not matter if there just a few rows in the table., but generally it can be a problem. ( I learned it the hard way with big tables).</description>
      <pubDate>Mon, 21 Jul 2003 05:23:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027990#M910129</guid>
      <dc:creator>Reinhard Burger</dc:creator>
      <dc:date>2003-07-21T05:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option in Oracle that will return the data in upper or lower case ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027991#M910130</link>
      <description>To answer your specific questions:&lt;BR /&gt;&lt;BR /&gt;There is no "global" or sessionwise Oracle parameter which will automatically upshift data on retrieval.&lt;BR /&gt;&lt;BR /&gt;The above postings are correct but if you can't change the source they may not help you.&lt;BR /&gt;&lt;BR /&gt;Do you have the option to add a trigger to the table to upshift on insert/update, so that the data is always stored in upper case ?&lt;BR /&gt;We do this on several tables (also we remove control chars, they seem to creep in all over the place). I can post example code if this would help.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;-- Graham</description>
      <pubDate>Mon, 21 Jul 2003 06:25:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027991#M910130</guid>
      <dc:creator>Graham Cameron_1</dc:creator>
      <dc:date>2003-07-21T06:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option in Oracle that will return the data in upper or lower case ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027992#M910131</link>
      <description>&lt;BR /&gt;    Thank you all for your answers.&lt;BR /&gt;&lt;BR /&gt;    In my case, a view seems to be the way to go, since I have  no access to the app code,  and I am REALLY, not supposed to change the table structures that belongs to the schemas. The app will not be supported if they find any foreign object in there.   The way we are solving this is by only adding a few things that we need, and IF we need to supply a dump of the DB for support purposes, we drop those objects, since they are mostly indexes.&lt;BR /&gt;&lt;BR /&gt;     I am running 8i, and the field in particular is a uniquely indexed field, so, performance should not be a problem :-)&lt;BR /&gt;&lt;BR /&gt;     Thanks again and Graham, would you supply my with some examples of your code as well ?&lt;BR /&gt;&lt;BR /&gt;     Cheers,&lt;BR /&gt;&lt;BR /&gt;Henrique&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Mon, 21 Jul 2003 12:35:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027992#M910131</guid>
      <dc:creator>Henrique Silva_3</dc:creator>
      <dc:date>2003-07-21T12:35:56Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option in Oracle that will return the data in upper or lower case ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027993#M910132</link>
      <description>HI,&lt;BR /&gt;&lt;BR /&gt;Just to summarise on the possibilities,&lt;BR /&gt;&lt;BR /&gt;In SQLserver it is all or nothing.  Either every search is case insensitive or not.  That is not necessarily a good thing either.&lt;BR /&gt;&lt;BR /&gt;The ways to do the case insensitive search in Oracle would be:&lt;BR /&gt;&lt;BR /&gt;A. function based indexes.&lt;BR /&gt;   create index emp_upper_idx on emp(upper(ename));&lt;BR /&gt;&lt;BR /&gt;B. a shadow column that is indexed and maintained by a trigger.  &lt;BR /&gt;&lt;BR /&gt;e.g.&lt;BR /&gt; &lt;BR /&gt;  alter table emp add upper_name varchar2(30);&lt;BR /&gt;  create trigger emp_trigger&lt;BR /&gt;  after insert or update on emp for each row&lt;BR /&gt;  begin&lt;BR /&gt;     :new.upper_ename := upper(:new.ename);&lt;BR /&gt;  end;&lt;BR /&gt;  /&lt;BR /&gt;  create index upper_ename on ename(upper_ename);&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;  select * from emp where upper_ename = 'KING';&lt;BR /&gt;&lt;BR /&gt;C. intermedia.&lt;BR /&gt;&lt;BR /&gt;D. using an index organized table you maintain.&lt;BR /&gt;&lt;BR /&gt;  create table upper_ename&lt;BR /&gt;  ( ename varchar2(30),&lt;BR /&gt;    rid   rowid, primary key (ename,rid) ) organization index;&lt;BR /&gt;&lt;BR /&gt;  create trigger emp_trigger&lt;BR /&gt;  after insert or update on emp for each row&lt;BR /&gt;  begin&lt;BR /&gt;     if (updating and nvl(:old.ename,'x') &amp;lt;&amp;gt; nvl(:new.ename,'x'))&lt;BR /&gt;     then&lt;BR /&gt;        delete from upper_ename where &lt;BR /&gt;            ename = upper(:old.ename) and rid = :old.rowid;&lt;BR /&gt;        insert into upper_ename values &lt;BR /&gt;        (upper(:new.ename),:new.rowid );&lt;BR /&gt;     elsif ( inserting ) &lt;BR /&gt;     then&lt;BR /&gt;        insert into upper_ename values &lt;BR /&gt;        (upper(:new.ename),:new.rowid );&lt;BR /&gt;     end if;&lt;BR /&gt;   end;&lt;BR /&gt;   &lt;BR /&gt;   and then query:&lt;BR /&gt;&lt;BR /&gt;    select * from &lt;BR /&gt;       emp where rowid in ( select rid &lt;BR /&gt;                              from upper_ename &lt;BR /&gt;                             where ename = 'KING' );&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;    or &lt;BR /&gt;    select emp.* &lt;BR /&gt;       from emp, upper_emp&lt;BR /&gt;      where emp.rowid = upper_emp.rid&lt;BR /&gt;        and upper_emp.ename = 'KING';&lt;BR /&gt;&lt;BR /&gt;(thats much like a function based index but your application must be aware of it). &lt;BR /&gt;&lt;BR /&gt;I believe the last solution(D - trigger) can still help....&lt;BR /&gt;&lt;BR /&gt;hope this helps too!&lt;BR /&gt;&lt;BR /&gt;regards&lt;BR /&gt;Yogeeraj</description>
      <pubDate>Mon, 21 Jul 2003 16:45:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027993#M910132</guid>
      <dc:creator>Yogeeraj_1</dc:creator>
      <dc:date>2003-07-21T16:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Is there an option in Oracle that will return the data in upper or lower case ?</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027994#M910133</link>
      <description>Henrique&lt;BR /&gt;&lt;BR /&gt;There are 2 files.&lt;BR /&gt;&lt;BR /&gt;I attach the larger one and put the smaller one in line (because I can't seem to attach &amp;gt; file).&lt;BR /&gt;&lt;BR /&gt;The attachment is a function which removes control chars and optionally upshifts.&lt;BR /&gt;&lt;BR /&gt;Inline below is an example trigger from one of our tables, STREET.&lt;BR /&gt;&lt;BR /&gt;Hope this helps.&lt;BR /&gt;&lt;BR /&gt;-- Graham&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;CREATE OR REPLACE TRIGGER TRG_STREET_PRINTABLE&lt;BR /&gt; BEFORE INSERT OR UPDATE &lt;BR /&gt; ON STREET&lt;BR /&gt; REFERENCING OLD AS OLD NEW AS NEW&lt;BR /&gt; FOR EACH ROW&lt;BR /&gt;BEGIN&lt;BR /&gt;    -- Remove all control chars from potentially vulnerable fields, by calling&lt;BR /&gt;    -- the corresponding function.&lt;BR /&gt;    -- The 2nd argument ('Y') means remove CR from input, and the 3rd (also 'Y') means upshift.&lt;BR /&gt;    :new.DEPENDANT_LOCALITY        := fn_remove_control_chars (:new.DEPENDANT_LOCALITY,        'Y', 'Y') ;&lt;BR /&gt;    :new.DEPENDANT_THOROFARE       := fn_remove_control_chars (:new.DEPENDANT_THOROFARE,       'Y', 'Y') ;&lt;BR /&gt;    :new.DOUBLE_DEPENDANT_LOCALITY := fn_remove_control_chars (:new.DOUBLE_DEPENDANT_LOCALITY, 'Y', 'Y') ;&lt;BR /&gt;    :new.THOROFARE                 := fn_remove_control_chars (:new.THOROFARE,                 'Y', 'Y') ;&lt;BR /&gt;END;&lt;BR /&gt;/&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Jul 2003 06:32:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/is-there-an-option-in-oracle-that-will-return-the-data-in-upper/m-p/3027994#M910133</guid>
      <dc:creator>Graham Cameron_1</dc:creator>
      <dc:date>2003-07-22T06:32:12Z</dc:date>
    </item>
  </channel>
</rss>

