Case unsensitive LIKE query
 
            
                
                    H_de_Graaf                
                
                    Member Posts: 7                
            
                        
            
                    Hello,
I'm connecting Navision with ASP.NET but if I run a query with the LIKE
statement I get a case sensitive search.
Is there a function to make the LIKE case unsensitive?
Regards,
Hans
                I'm connecting Navision with ASP.NET but if I run a query with the LIKE
statement I get a case sensitive search.
Is there a function to make the LIKE case unsensitive?
Regards,
Hans
0                
            Comments
- 
            ... use a further field like the matchcode-field (code-field)0
- 
            I think you must use the "@" command. Best place to find an answer to this question would be a SQL manual."Real programmers don't comment their code.
 If it was hard to write, it should be hard to understand."0
- 
            I want to use the name field, it is data type 'Text'.
 If I search 'de graaf' and the name is 'de Graaf' I'm getting no results because it's case sensitive.
 My query:
 SELECT Name FROM Contact WHERE Name LIKE '%"+ [keyword] +"%' ORDER BY No_
 I also tried the @:
 SELECT Name FROM Contact WHERE Name LIKE '%@+ [keyword] +%' ORDER BY No_
 Where can I find the SQL manual? I have the C/ODBC guide but the answer isn't there.0
- 
            Oooooh yeah.... the % charater... That must be it, I'm sure that's it... How could I forget.
 I developed some site using php and mysql. mysql should be very much the same (the same) as sql. I used this manual :
 http://www.mysql.com/doc/en/index.html
 here you can find the answer to your question (maybe):
 http://www.mysql.com/doc/en/Case_sensitivity.html
 Hope it helps"Real programmers don't comment their code.
 If it was hard to write, it should be hard to understand."0
- 
            I'm not using MySQL or SQL server I'm using Navision Server C/ODBC.
 So not al sql functionality is supported.0
- 
            did you try the @ char without the %?
 If that;s not it, then I can't help you any further... sry.
 Hope you'll find a solution."Real programmers don't comment their code.
 If it was hard to write, it should be hard to understand."0
- 
            Yes I did...
 Thanks for your help anyway.
 Is there someone else who has the right solution for my problem???0
- 
            I have the same problem.
 Marco Morreale0
- 
            I also experience the same problem when searching in php.
 <?php
 $db = odbc_connect ("Navision", "user", "pass") or die("Unable to connect to ODBC");
 $query = "select * from Customer where Name like '$search_str'";
 $result = odbc_exec($db, $query);
 ?>
 No matter how I write the search string, it always does a case sensitive search 0 0
- 
            Force your search string to uppercase, and then search the "Search Name" field.
 $search_str = strtoupper($search_str);
 $query = "select * from Customer where Search_Name like '$search_str'";0
- 
            OR in Mysql:
 select * from Customer where Search_Name like binary '$search_str'
 DOC:
 The following two statements illustrate that string comparisons are not case sensitive unless one of the operands is a binary string:
 mysql> SELECT 'abc' LIKE 'ABC';
 -> 1
 mysql> SELECT 'abc' LIKE BINARY 'ABC';
 -> 00
- 
            a "little bit" late , but I was also searching on this topic. Solution is to use Case Insensitive Collection for SELECT: , but I was also searching on this topic. Solution is to use Case Insensitive Collection for SELECT:
 SELECT Name FROM Contact WHERE Name LIKE '%"+ [keyword] +"%' COLLATE Latvian_CI_AS ORDER BY No_0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 323 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions






