Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

the condition for searching problem....

 
Barry Tsai
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, guys
I got a problem.Would your kindly tell me how to do?
My problem is:
My exam project ask me to accomplish the following condition:
"It must allow the user to search the data for all records, or for records where the name and/or location fields exactly match values specified by the user."
Is that mean I just let user use name and location as the condtion for searching??Don't need let user use the other field as the condtion for searching.

thx a lot
BestRegards,

Barry
 
Omar Kalaldeh
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Barry,

I believe so, client have to search using those two fields only, but keep in your mind to make your code as general as possible, so if in the future appears the need for new fields to search on, that will be with minimum amount of changes .

And note that the server had to handle the general case, regardless the client search criteria.

I hope this answer will help you.
 
Omar Kalaldeh
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Barry,

At first let me I apologize for my mistake and inaccurate reply ,

after rereading the instructions I found that search must be done in two forms, first one is by searching all records for some criteria such as the rate and owner, so it will be more like the following query

Select all where rate = �10� and owner = �Barry�.

The second form of search will be for the records that have exact name and/or location with search criteria, and it will be like the following query

Select where
name = �Omar� and location = �x�
And rate = �10� and owner = �Barry�.

and I hope I get it right this time, and sorry again.

Please if you read this reply tell me or I will feel guilty
[ June 10, 2004: Message edited by: Omar Kalaldeh ]
 
S Perreault
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I interpreted it much more differently.

Search types
------------

1) All records - return ALL records in the database
2) Name - return all records where name equals 'String'
3) Location - return all records where location equals 'String'
4) Name and Location - return all records where name equals 'String1' AND location equals 'String2'

I NEVER search using any other criteria than Name or Location...that being said, I haven't sent in my assignment either =)

Perogi.
 
Omar Kalaldeh
Ranch Hand
Posts: 58
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi S Perreault,

I don�t think search the data for all records mean return all records, else they were told us from the begging return all records instead of using 'search' word.

at first I interpreted as you said, but after reading it a gain I went to my second guess.

I am not saying my interpreted definitely the right one, but I see like that
[ June 10, 2004: Message edited by: Omar Kalaldeh ]
 
Ste Graham
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So, what are peoples general consenus on this? When it says "records where the name and/or location fields match values specified by the user" does it mean a boolean AND or a boolean OR?

i.e

1. AND - only show records that contain both the name and location
2. OR - show records that contain one or the other search term

or is just another example of where you have to justify, in your documentation, why you took the decision you did?

Stephen
 
Eric Chang
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Personally, I think you might be looking too hard at things. I take the instructions to mean that you must be able to return all the records (if there is no search criteria specified), or search using Name and/or Location, in that I can search using just Name criteria, or using just Location criteria, or a combination of the two. I don't take the and/or as constraints in the query in that I can put criteria in both Name and Location and get a return on all the records with either the Name or the Location.
And the usefulness of the returning all the records would be if I performed a search on a Name, which returned 2 records, and then wanted to revert the JTable back to a display of all the records.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic