Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

search error

Posted on 2010-01-11
5
Medium Priority
?
272 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
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

Industry Leaders: 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

Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

564 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