Home » SQL & PL/SQL » SQL & PL/SQL » Finding empty strings with LIKE (Oracle 9i, Windows)
Finding empty strings with LIKE [message #353911] Wed, 15 October 2008 10:21 Go to next message
hotzenplotz
Messages: 1
Registered: October 2008
Junior Member
Hi,

In my Java application I use prepared statements for filtering a table. I want to be able to filter strings, which works fine already. But I also need to specifically find records with empty strings in the table, which does not work using the LIKE condition.

Here is the SQL statement I use:

String FIND_BAS = 
SELECT * FROM LIC_SEARCH_BA 
WHERE BASTATUSID LIKE ? AND COMPANY LIKE upper(?) AND NAME_UPPER LIKE upper(?) AND BANUMBER LIKE ?";


How can I change it to find also records with empty BANUMBER for example?

Martin

[Updated on: Wed, 15 October 2008 11:49] by Moderator

Report message to a moderator

Re: Finding empty strings with LIKE [message #353917 is a reply to message #353911] Wed, 15 October 2008 10:50 Go to previous message
cookiemonster
Messages: 12422
Registered: September 2008
Location: Rainy Manchester
Senior Member
WHERE (BANUMBER LIKE ? OR BANUMBER IS NULL)
Previous Topic: Self Join
Next Topic: Synonyms, Execute Immediate, ***on another user for another user***
Goto Forum:
  


Current Time: Sun Dec 11 08:00:21 CST 2016

Total time taken to generate the page: 0.08986 seconds