• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC : ODBC bridge

 
Ralph Kehmeier
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Everyone;

Question: in using the Java JDBC DBC bridge to access a text file, how does one perform a case-insensitive SQL query on a text field using the LIKE keyword? The following query, for example, insists on being case-sensitive:
SELECT * FROM <file name>.txt WHERE NAME LIKE '%Smith%'

It seems to me that anyone querying a text field in a database would want at least the possibility of making it case-insensitive, in order to find records with typos such as "sMith". But I've searched high and low for this information and have come up dry.

On a related subject: although SQL is clearly used by half the civilized world, hours of searching on the www for a free, downloadable description of standard SQL have once again been fruitless. What is the top-secret font of SQL knowledge, known only to the initiate?

Thanks,
Ralph
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35274
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ralph,
Welcome to JavaRanch!

Try the following?
SELECT * FROM <file name>.txt WHERE UPPER(NAME) LIKE '%SMITH%'

I don't know of an online reference that describes standard SQL either. I've always used the database specific ones. Note that not all vendors completely implement the standard completely.

For a printed book, SQL in a Nutshell describes the standard.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic