home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #18 / NN_1992_18.iso / spool / comp / database / ingres / 1121 < prev    next >
Encoding:
Internet Message Format  |  1992-08-12  |  1.3 KB

  1. Path: sparky!uunet!charon.amdahl.com!amdahl!rtech!ingres!kerry
  2. From: kerry@Ingres.COM (Kerry Kurasaki)
  3. Newsgroups: comp.databases.ingres
  4. Subject: Re: SQL 'like' command with case insensitivity?
  5. Message-ID: <1992Aug12.173714.17470@pony.Ingres.COM>
  6. Date: 12 Aug 92 17:37:14 GMT
  7. References: <1992Aug12.002043.1970@candle.uucp>
  8. Reply-To: kerry@Ingres.COM (Kerry Kurasaki)
  9. Organization: Ask Computer Systems Inc., Ingres Division, Alameda CA 94501
  10. Lines: 26
  11.  
  12. In article <1992Aug12.002043.1970@candle.uucp> root@candle.uucp (Bruce Momjian) writes:
  13. >I need to do an SQL statement where I need pattern matching that is
  14. >case-insensitive.  In both SQL and 4GL, this statement is illegal:
  15. >
  16. >    select *
  17. >    from tablea
  18. >    where uppercase(col) like '%YES%';
  19. >
  20. >It complains about the 'like'.  I have called Ingres.  The tech first
  21. >thought it was an easy solution, then he talked to some people and
  22. >basically says it's a limitation.
  23. >
  24. >The only two workarounds I can think of are to add another column that
  25. >always has 'col' as uppercase, or in 4GL to attach a block of code to
  26. >the select and for every row, uppercase the field, and then compare with
  27. >a select.
  28. >
  29.  
  30. Unfortunately, the grammar for the LIKE predicate is:
  31.  
  32.     <column name> LIKE <expression>
  33.  
  34. Another method is to create a view with the uppercase() function.
  35. You will not be able to update it though.
  36.  
  37. Kerry
  38.