Query of queries case sensitive

Hi,
I've a question regarding this issue.  I am pulling data from an xml file and dump that data into query of queries then output them.  The problem is when I try to order the query ASC, the upper will be top and the lower will be on the bottom.  Is there a way to sort them before dump data into query?  Or any ways of getting around this?
Thanks.

Depending on your requirements, you might want to add a new column to the query, rather than calling upper() on your actual data column... it depends on whether you want your data column to be all upper case (like if you are displaying it).
So instead of this:
SELECT col1, upper(col2)
FROM q
ORDER BY col2
Have this:
SELECT col1, col2, upper(col2) AS col2Sort
FROM q
ORDER BY col2Sort
It doesn't always matter, obviously, but it's handy to keep it in mind.
Adam

Similar Messages

  • How to retrieve column names in a query in a case sensitive way

    Given a query, I want to extract all the column names/aliases in the query in a case-sensitive way.
    When I use dbms_sql.describe_columns() or java.sql.ResultSetMetaData classes getColumnName() or getColumnLabel()
    it returns the columns name ONLY in Upper case.
    My application needs to extract the column names in the same case as it appears in the query string.
    Is there any API to get this without parsing the SQL query string?
    Thanks
    PS: The dbms_sql.describe_columns() returns the column name in upper case.
    declare
    IS
    l_column_recs DBMS_SQL.DESC_TAB;
    l_cur NUMBER;
    l_column_count NUMBER;
    BEGIN
    l_cur := dbms_sql.open_cursor;
    dbms_sql.parse(l_cur, 'select target_type from targets', dbms_sql.NATIVE);
    dbms_sql.describe_columns(l_cur, l_column_count, l_column_recs);
    FOR i IN l_column_recs.FIRST..l_column_recs.LAST
    LOOP
    dbms_output.put_line(l_column_recs(i).col_name);
    end loop;
    end;
    /

    As far as the result set is concerned, though, the column name is in all upper case. If you query the data dictionary, you would see that the TARGET_TYPE column in the TARGETS table is stored in upper case.
    The way Oracle works is that column names that are not enclosed in double-quotes are converted to upper case in the data dictionary and elsewhere and then Oracle looks for the column name in the table definition. That is what allows Oracle to have case-insensitive identifiers unless a user specifies case-sensitive identifiers by enclosing the identifier in double quotes.
    If you changed the query to be
    SELECT target_type as "target_type"
      FROM targetsOracle should report the alias in a case sensitive fashion because you've now indicated that the alias should be treated as case sensitive.
    Justin

  • The query screens are case sensitive I want to remove the case sensitivity

    The current query screens are case sensitive ,I want to remove the case sensitivity is there a setting somewhere to remove this or how else can this be done.
    Example:In the restrict value range of the query screen.If we give for a particular field anything in capital letters/small it should take.
    Please let me know ASAP
    Thanks

    Hi pavan,
    generally case sensivity is related to InfoObject Master Data.
    Take a look via Tcode RSD1 to the master data of your InfoObject and check in first screen if flag for capitol letters has been marked.
    If this is the situation it is a problem, because MAster Data in cube have been saved as different if are written like "Letter" or "LETTER".
    Ciao.
    Riccardo.
    Message was edited by:
            Riccardo Venturini

  • Can we write select query regardless of case sensitivity?

    Hello Everyone,
    I have written one function module. And in this FM i am using one import parameter which has Data element and domain as type. In that i have checked Upper/Lower case checkbox, to retain case of the data in table. But when firing query to database i have to supply same case as it is stored in table.
    so, can i ignore the case of the parameter in select query and can i fire the query regardless of the case of the where conition??
    Thanks in Advance,
    Bhavik

    Hi Bhavik,
    You can do this without adding a column to the table.
    Just Fetch all the data in one internal table then loop that table inside that loop check whether that field contains that string or not. For this you use CP operator, that checks for string irrespective of the case. This can perform wild serach also. The following code may help you,
        SELECT * FROM /cpd/d_mp_hdr_s INTO TABLE it_mast_hdr_desc1.
        LOOP AT it_mast_hdr_desc1 INTO wa_mast_hdr_desc.
          IF wa_mast_hdr_desc-text CP lv_mp_text.
            APPEND wa_mast_hdr_desc TO it_mast_hdr_desc.
            CLEAR wa_mast_hdr_desc.
          ENDIF.
        ENDLOOP.
    Here both the internal table and the work area are of type /cpd/d_mp_hdr_s.
    Hope this helps you.
    With Regards,
    Ajeet Pratap Singh

  • Oracle query sort by case sensitive

    Hi All,
    I am using oracle database 11g.
    My use case is I do have a table with following values
    Table name -test
    product id     productsortdescription
    H58098        ACETAMIDOHYDROXYPHENYLTHIAZOLE
    043994         Alloy .MM.INTHICK
    My query is
    select * from test order by productsortdescription;
    this query gives result as is like
    product id     productsortdescription
    H58098        ACETA
    product id     productsortdescription
    H58098        ACETAMIDOHYDROXYPHENYLTHIAZOLE
    043994         Alloy .MM.INTHICK
    MIDOHYDROXYPHENYLTHIAZOLE
    043994         Alloy .MM.INTHICK
    but Expected output/result should be like below:
    product id     productsortdescription
    043994    
    Alloy .MM.INTHICK
    H58098      ACETAMIDOHYDROXYPHENYLTHIAZOLE
    as All and ACE in productsortdescription
    l is in small case than C.
    NLS Session parameters are as following
    SELECT * from NLS_SESSION_PARAMETERS;
    NLS_LANGUAGE    AMERICAN
    NLS_TERRITORY    AMERICA
    NLS_CURRENCY    $
    NLS_ISO_CURRENCY    AMERICA
    NLS_NUMERIC_CHARACTERS    .,
    NLS_CALENDAR    GREGORIAN
    NLS_DATE_FORMAT    DD-MON-RR
    NLS_DATE_LANGUAGE    AMERICAN
    NLS_SORT    BINARY
    NLS_TIME_FORMAT    HH.MI.SSXFF AM
    NLS_TIMESTAMP_FORMAT    DD-MON-RR HH.MI.SSXFF AM
    NLS_TIME_TZ_FORMAT    HH.MI.SSXFF AM TZR
    NLS_TIMESTAMP_TZ_FORMAT    DD-MON-RR HH.MI.SSXFF AM TZR
    NLS_DUAL_CURRENCY    $
    NLS_COMP    BINARY
    NLS_LENGTH_SEMANTICS    BYTE
    NLS_NCHAR_CONV_EXCP    FALSE
    Please help me out in this scenario.

    Are you looking for something like
    with
    names as
    (select 'Etbin' n from dual union all
    select 'etbin' from dual union all
    select 'ETBIN' from dual union all
    select 'ACETAMIDOHYDROXYPHENYLTHIAZOLE' from dual union all
    select 'Alloy .MM.INTHICK ' from dual union all
    select 'another name' from dual union all
    select 'Aalto; Hugo Alvar Henrik' from dual union all
    select 'astrerisk' from dual union all
    select 'Ezekiel' from dual union all
    select 'zylog' from dual
    expansion as
    (select n,listagg(duo) within group (order by l) ord
       from (select n,level l,
                    case when ascii(substr(n,level,1)) between 97 and 122
                         then '0'
                         when ascii(substr(n,level,1)) between 65 and 90
                         then '1'
                         else '2'
                    end || substr(n,level,1) duo
               from names
             connect by prior n = n
                    and prior dbms_random.random is not null
                    and level <= length(n)
      group by n
    select n
      from expansion
    order by ord
    N
    another name
    astrerisk
    etbin
    zylog
    Aalto; Hugo Alvar Henrik
    Alloy .MM.INTHICK
    ACETAMIDOHYDROXYPHENYLTHIAZOLE
    Etbin
    Ezekiel
    ETBIN
    Regards
    Etbin

  • Can a LOV popup search be made case sensitive?

    Can a LOV popup based on a SQL table query be made case sensitive. By default it looks like it is case insensitive by the text on the popup.

    I think you might need to look at doing some customization to your custom managed properties , you can manipulate the values within the managed properties by mapping them to single values  check custom content processing 
    http://msdn.microsoft.com/en-us/library/office/jj163968(v=office.15).aspx
    Hope that helps|Amr Fouad|MCTS,MCPD sharePoint 2010

  • 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

  • Case Sensitive Problem in the query

    Hii All
    Good Day
    I have created zperson infoobject & has lowercase letters tick marked.
    This is the navigational attribute of 0activity infoobject.
    The user wants to have the functionality of
    "The text field should be non-case sensitive so when it is used in a query to search the name can be typed in whichever case a person wants"
    How to do this? can any one suggest?
    regards
    Jana.

    Hello,
    I dont have a solution to convert the value automatic in the selection variables. but as an alternate solution: When you load data for zperson, use formula or routine to translate to upper case. Then the user can always use uppercase in the selection.
    Happy Tony

  • Query in expdp with case-sensitive table and columnname

    Hi,
    I've got a problem with exporting some specific rows of a table.
    The problem is a case-sensitive table and column name. I've tried this in a parfile:
    dumpfile=dpumpdir1:test.dmp
    logfile=dpumpdir1:test.log
    tables="Data"
    query="Data":'"where "DataID" = 11"'
    but it ended like this:
    ORA-31693: Table data object "Data" failed to load/unload and is being skipped due to error:
    ORA-06502: PL/SQL: numeric or value error
    ORA-31605: the following was returned from LpxXSLSetTextVar in routine kuxslSetParam:
    LPX-314: an internal failure occurred
    Edited by: [Logik on 18.04.2013 01:18                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

    I've tried to make a function with this. I think you used some Oracle 11 parameters. reusefile for example.
    However I've managed to compile the function without error:
    CREATE OR REPLACE FUNCTION EXPDP RETURN NUMBER IS
      h1 number;
      v_job_state       varchar2(4000);
    BEGIN
      h1 := dbms_datapump.open(operation=>'EXPORT',job_mode=>'TABLE',job_name=>'HARRY10');
      dbms_datapump.add_file(h1,'example1.dmp','DPUMPDIR1');
      dbms_datapump.add_file(h1,'example1.log','DPUMPDIR1',filetype => dbms_datapump.ku$_file_type_log_file);
      dbms_datapump.metadata_filter(handle => h1,name => 'NAME_EXPR',value => 'IN (''Data'')',object_type => 'TABLE');
      dbms_datapump.data_filter(handle => h1,name => 'SUBQUERY',value => 'WHERE "DataID" = 1');
      dbms_datapump.start_job(h1);
      DBMS_DATAPUMP.WAIT_FOR_JOB (h1,v_job_state);
      DBMS_OUTPUT.PUT_LINE(v_job_state);
      RETURN NULL;
    END EXPDP;But when I execute I get:
    ORA-31626: job does not exist
    ORA-06512: at "SYS.DBMS_SYS_ERROR", line 79
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 938
    ORA-06512: at "SYS.DBMS_DATAPUMP", line 4592
    ORA-06512: at EXPDP", line 5
    ORA-06512: at line 5
    Probably not my day :(
    By the way... how can I Format the text as a script?
    Edited by: [Logik on 19.04.2013 11:01                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

  • Case-sensitive wild-cards in Select Query

    Hi,
    I have to make a search help for Portal like it is in standard SAP's Who's Who search help in HR-ESS.
    I have to fetch data (wildcards) from Portal & on the basis of that I need to give them the actual no. of matching data.
    In short, I'll take only one data, say 'Short Text of Organizational Unit' - T527X-ORGTX .... ( 'Organizational unit' - PA0002-ORGEH ).
    Here, in this case, I'm converting all '*' with '%' with this statement :
      ORGTX1 = ORGTX.
      REPLACE ALL OCCURRENCES OF '*' IN
      ORGTX1 WITH '%' .
      SELECT ORGEH FROM T527X
               INTO CORRESPONDING FIELDS OF TABLE itab
               WHERE ORGTX like ORGTX1
               and        SPRSL = 'EN'.
    My problem comes, when the user enters data like HR dep and the actual data in the table is HR Department, then the select query doesn't work.
    I'm providing some other cases:
    Provided data by User           Actual Data in Syatem
    emp                                    Employee
    EMP1*                                Employee1
    hr                                        HR
    Hr                                       HR
    so many, other permutations & combinations like this.
    I've checked so many threads, but didn't get the actual answer. Some persons are saying to use translate, but I can only use translate after fetching the data. here the problem is with fetching itself & I can't judge at runtime that which letter the user will put in upper case & which in lowercase.
    Can someone please guide me, how to tackle this problem ???

    Hello Mohit,
    First of all, welcome to SDN!
    What you have done as far as the implementation of the solution is concerned is quite correct. Please understand that wildcard search in SAP is case sensitive - so if the user enters data like HR dep * and the actual data in the table is HR Department then the user will not get any results back which is fully justified i.e. that's the way it should be. If you refer back to the table T527X and try a wildcard search on field ORGTX, the result is the same if you enter what the user is entering on the Portal i.e. HR dep*.
    I think the users should be aware that this is how wildcard searches are designed to behave in SAP - this could be part of their training or you can even produce a message in your program when the select query fails.
    The other option is of course to use TRANSLATE but there could be so many scenarios / permutation combinations - I don't suggest anyone goes that way to "guess" (or read) user's mind then deliver the solution because there will come a scenario when the program will be unable to "read" the user's mind as a result the select query will inevitably fail.
    Hope this helps.
    Cheers,
    Sougata.

  • Excel Query case sensitive problem

    HI all I am writing query in excel to join table. however I find it is case sensitive.  which cause many trouble.
    how to make it case incensitive.
    SELECT *
    FROM `C:\compare.xlsx`.`sheet1$` a
    left join `C:\compare.xlsx`.`sheet2$` b
    on a.`name`=b.`name`
    union
    SELECT *
    FROM `C:\compare.xlsx`.`sheet1
    right join `C:\compare.xlsx`.`sheet2$` d
    on c.`name`=d.`name`

    Hi,
    I tested it with my data source (I create it like this, not use all of the month). Would you like to share us a sample file through OneDrive if possible?
    If you have further question about the SQL sentence, I recommend you post your issue to SQL forum.
    http://social.technet.microsoft.com/Forums/en-US/home?category=sqlserver
    Regards,
    George Zhao
    TechNet Community Support

  • 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

  • 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.

  • Oracle is Case Sensitive, can we change this.?

    Hi all,
    As Oracle Data is a Case sensitive.
    but i want to know that,
    is there any way to change this ?
    that is , the data should not be a case sensitive.
    select * from emp where ename = 'smith';
    Even the SMITH is in caps. it should return that records for the above query.
    Thanks.
    GowriShankar.N

    As a one off for queries you can use the UPPER and LOWER functions, ie;
    select * from emp where LOWER(ename) = 'smith';

  • Case sensitive issue CF7 & SQL 2005

    I had to rebuild a database from a backup recently. Now I am having a case sensitive issue in my queries that I did not have before.
    The following use to work with Rockmart in lowercase even though Rockmart was in the table as all uppercase like so ROCKMART.
    <cfquery name="updateAreas" datasource="mySource">
       UPDATE Property
       SET AR = 3610
       WHERE  City = 'Rockmart'
    </cfquery>
    The above has stopped working now the query must specify ROCKMART because it is in the table in all upper case.
    My database option is set to SQL_Latin1_General_CP1_CI_AS
    Any ideas.
    Many thanks for you help.
    Brian

    A collation can be specified at the server, database, and column level in SQL server.  The column collation will take precedence over the database collation.  Check that the collation for the column is case-insensitive.  You can use the query below to get the column's collation.
    SELECT COLUMN_NAME, COLLATION_NAME
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_NAME = 'Property'
        AND COLUMN_NAME = 'City'
    You can get info on the collations supported by SQL Server at:
    http://msdn.microsoft.com/en-us/library/ms144250%28SQL.90%29.aspx
    You can change a column's collation if you need to, but you should be sure that this will not affect any other applications which query the same data.  Another option is to specify the desired collation in your query as suggested by glynjackson.
    http://msdn.microsoft.com/en-us/library/ms190920%28SQL.90%29.aspx

Maybe you are looking for

  • Save Dialog Box

    Apparently I am in the extreme minority, but I really do miss the save dialog box when saving attachments in Mail. Is there anyway to kill off the automatic saving to the Downloads folder? And no I am not interested in merely moving the default from

  • Sign in to iCloud keeps poping up i have changed the pasward but it still wont let me on how do i sign on?

    Sign in to iCloud keeps popping up on my ipod screen and it wont let me do anything. I reset the pasword but it wont login.

  • Authority check - in terms of User Group

    Hi all, I need restrict the usage of a finnance report by order of users.the report has order grup as an input, only certain order groups should be viewed by certain users. in authority check can do the checking by using user groups instead of indivi

  • Posting Vendor special GLs

    Hi I have created a new special GL indicator as J for rental deposits to vendor.  I want to post transaction using special GL J. I cannot use f-48 since special GL indicator is not created as downpayment. So let me know which TCode needs to be used.

  • SWEHR3 configuration : Can multiple FMs be triggered by a single config?

    Hello, Is it possible to attach two different function modules to a similar SWEHR3 configuration changing only the sequence number? I want to update 2 different infotypes at the initiation of a single event (lets say  - when O-S relat B012 is maintai