Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

case sensetive search in SQL

Hello,
how can I do case sensetive string search in SQL im using an access db and ODBC

Comments

  • infidelinfidel Posts: 2,900Member
    : Hello,
    : how can I do case sensetive string search in SQL im using an access db and ODBC

    SQL is case sensitive automatically.

    select * from table where field = 'FoObAr'

    will find only records where the specified field exactly matches 'FoObAr'. If you want a case INsensitive search, use upper or lower:

    select * from table where upper(field) = 'FOOBAR'

    Same goes for wildcards

    select * from table where upper(field) like '%FOOBAR%'


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

  • hakanbengtsenhakanbengtsen Posts: 5Member
    : : Hello,
    : : how can I do case sensetive string search in SQL im using an access db and ODBC
    :
    : SQL is case sensitive automatically.
    :
    : select * from table where field = 'FoObAr'
    :
    : will find only records where the specified field exactly matches 'FoObAr'. If you want a case INsensitive search, use upper or lower:
    :
    : select * from table where upper(field) = 'FOOBAR'
    :
    : Same goes for wildcards
    :
    : select * from table where upper(field) like '%FOOBAR%'
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :
    :
    That was strange because I have tried to to exactly the same as in your example but it wont work ... hmmm maybe i missing somthing, thanx anyway // hakan
  • DaedaliusDaedalius Posts: 30Member
    I believe that if you check your collation and Infidel's collation you will find that they are different.

    : : : Hello,
    : : : how can I do case sensetive string search in SQL im using an access db and ODBC
    : :
    : : SQL is case sensitive automatically.
    : :
    : : select * from table where field = 'FoObAr'
    : :
    : : will find only records where the specified field exactly matches 'FoObAr'. If you want a case INsensitive search, use upper or lower:
    : :
    : : select * from table where upper(field) = 'FOOBAR'
    : :
    : : Same goes for wildcards
    : :
    : : select * from table where upper(field) like '%FOOBAR%'
    : :
    : :
    : : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    : :
    : :
    : That was strange because I have tried to to exactly the same as in your example but it wont work ... hmmm maybe i missing somthing, thanx anyway // hakan
    :

  • hakanbengtsenhakanbengtsen Posts: 5Member
    I found the problem... I using ODBC and a access database ... these databases is not case-sensitive, I have to change to oracle or mySQL... or if there is some function that I can use.. I think I will use mySQL instead.

    thanx for the help // hakan

    : I believe that if you check your collation and Infidel's collation you will find that they are different.
    :
    : : : : Hello,
    : : : : how can I do case sensetive string search in SQL im using an access db and ODBC
    : : :
    : : : SQL is case sensitive automatically.
    : : :
    : : : select * from table where field = 'FoObAr'
    : : :
    : : : will find only records where the specified field exactly matches 'FoObAr'. If you want a case INsensitive search, use upper or lower:
    : : :
    : : : select * from table where upper(field) = 'FOOBAR'
    : : :
    : : : Same goes for wildcards
    : : :
    : : : select * from table where upper(field) like '%FOOBAR%'
    : : :
    : : :
    : : : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    : : :
    : : :
    : : That was strange because I have tried to to exactly the same as in your example but it wont work ... hmmm maybe i missing somthing, thanx anyway // hakan
    : :
    :
    :

  • infidelinfidel Posts: 2,900Member
    : I found the problem... I using ODBC and a access database ... these databases is not case-sensitive, I have to change to oracle or mySQL... or if there is some function that I can use.. I think I will use mySQL instead.

    How typical. I hate Microsoft.


    [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]

  • DaedaliusDaedalius Posts: 30Member
    I think you should restate. SQL Server will support case sensitivity you just have to use the proper collation.

    : : I found the problem... I using ODBC and a access database ... these databases is not case-sensitive, I have to change to oracle or mySQL... or if there is some function that I can use.. I think I will use mySQL instead.
    :
    : How typical. I hate Microsoft.
    :
    :
    : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    :
    :

  • hakanbengtsenhakanbengtsen Posts: 5Member
    Hmmm, I have done some tests + search for some help on the Microsoft web but there nothing to convince me otherwise.... But Im not using SQL server it's too expensive for me, Im using a simple ODBC connection with a access database and what I can see, theres no case-sensitive support for the SQL parser in access.
    I found this site who compares oracle with access maybe they also has got it wrong

    http://www.cse.bris.ac.uk/~ccmjs/ora_sql.htm#Aggregate functions



    : I think you should restate. SQL Server will support case sensitivity you just have to use the proper collation.
    :
    : : : I found the problem... I using ODBC and a access database ... these databases is not case-sensitive, I have to change to oracle or mySQL... or if there is some function that I can use.. I think I will use mySQL instead.
    : :
    : : How typical. I hate Microsoft.
    : :
    : :
    : : [size=5][italic][blue][RED]i[/RED]nfidel[/blue][/italic][/size]
    : :
    : :
    :
    :

Sign In or Register to comment.