To make table data case insensitive

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • getmeidea
    New Member
    • Feb 2007
    • 36

    To make table data case insensitive

    Hi,
    The table data in my database is set to be case sensitive.
    How will i make it to case insensitive.
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Data in table is not case-sensitive, untill unless u want to to be by using some functions like UPPER or LOWER of some few other
    .
    If u r using any of those remove that and store data directly into the table.

    But if your problem is different ,please do post back

    Comment

    • chandu031
      Recognized Expert New Member
      • Mar 2007
      • 77

      #3
      Originally posted by getmeidea
      Hi,
      The table data in my database is set to be case sensitive.
      How will i make it to case insensitive.
      Hi (getmeidea?),

      I assume your requirement is something like this:
      If say a value 'a' has gone in for a filed ,then a value 'A' should not go in .

      Then one of the methods is to create a unique index on this field
      [code=sql]

      create unique index <index_name> on <table>(lower(< field>));

      [/code]

      You can use either lower or upper, it doesnt matter. With this, if a value goes in , the same value cannot go in irrespective of the case. Ofcourse , to implement this you will have to identify all the varchar fields in your table and create seperate indexes on them.

      If this is not your requirement, then please do let me know.

      Comment

      • getmeidea
        New Member
        • Feb 2007
        • 36

        #4
        Originally posted by debasisdas
        Data in table is not case-sensitive, untill unless u want to to be by using some functions like UPPER or LOWER of some few other
        .
        If u r using any of those remove that and store data directly into the table.

        But if your problem is different ,please do post back
        Hi,

        Using upper() and lower() function is the not the proper solution i need. Because when i will be passing query from so many places in my front-end application. Hence i may have to take care of using this upper() and lower(). Instead if the database do the comparison ignoring the case, it will be more comfortable.

        So let me know how to set that property in database.

        Thanking you,
        Dileep

        Comment

        • debasisdas
          Recognized Expert Expert
          • Dec 2006
          • 8119

          #5
          either u need to store data using functions or retrive using functions to compare.

          Comment

          Working...