?
Solved

search error

Posted on 2010-01-11
5
Medium Priority
?
271 Views
Last Modified: 2012-08-14
Java application:
After I put a cursor in a search field (String) and click on space bar, I got an error: my WHERE clause with LIKE stops working. I use a delimiter(" ") in this search.
What is a solution of this problem: how I can capture a white space and return "No records available"?
Thank you for your help.
0
Comment
Question by:coPilot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 11

Expert Comment

by:sompol_kiatkamolchai
ID: 26290365
Hi coPilot,

You should validate input string after split it before making a query by using LIKE.

After you split it, you should validate it one by one. If there is no valid search string, you just return the "No records available"

Hope this help,
Sompol
0
 
LVL 20

Expert Comment

by:Sathish David Kumar N
ID: 26290545
If u use JavaScript means u can check that white speace there itself !! and set the error msg in innerHTML

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 26291210
>>After I put a cursor in a search field (String) and click on space bar, I got an error: my WHERE clause
with LIKE stops working.

Why would you do that? Surely if you do, you'd want it to return *all* records? If so, you should see that your program does just that
0
 
LVL 12

Accepted Solution

by:
Gibu George earned 1000 total points
ID: 26292398
Either you need to do as CEHJ suggested or add javascript validation to make sure that empty string is not send across
0
 

Author Closing Comment

by:coPilot
ID: 31675931
partial solution
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
Suggested Courses
Course of the Month8 days, 16 hours left to enroll

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question