DB2 Case Insensitivity

Posted on 2007-10-04
Last Modified: 2008-01-09
Is there a command I can use in DB2 to make it case-insensitive?  I'm trying to query a field that contains Last Names...  but it's entered by the user so Smith could be SMITH or Smith or sMITH, etc.  I was using WHERE IN('value','value') but that doesn't seem very efficient.
Question by:z018196
    1 Comment
    LVL 18

    Accepted Solution


    Well, the easiest method is to use the UPPER function.

    where upper(myColumn) = 'VALUE'

    But, that method may cause performance problems since it makes any index over myColumn unusable. (You'll have to test how much of a performance problem it is. Depending on your query, it may not affect it at all.)

    Alternately (at least on DB2 for iSeries), you can specify your data and queries to use a sort-sequence of LANGIDSHR.  That causes all SELECT's to be case-insensitive.


    Featured Post

    Threat Intelligence Starter Resources

    Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

    Join & Write a Comment

    Suggested Solutions

    Title # Comments Views Activity
    ports for sccm 2012 1 33
    Windows Firewall Exceptions 5 43
    Deploy Windows 10 with WDS 11 46
    how to roll into all sub dirs 7 19
    Recursive SQL in UDB/LUW (it really isn't that hard to do) Recursive SQL is most often used to convert columns to rows or rows to columns.  A previous article described the process of converting rows to columns.  This article will build off of th…
    If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
    The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
    With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

    733 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now