|
| Re: Handling "The" In Database Entries/Searches |
 |
Tue, 1 Apr 2008 16:22:32 +0000 |
You could use an INSERT trigger. The trigger would fire on an insert and you
could test for whatever conditions you wanted and update the data accordingly
from the trigger.
|
| Post Reply
|
| Handling "The" In Database Entries/Searches |
 |
Tue, 1 Apr 2008 19:12:52 +0000 |
I'm not sure this is a common scenario, but I'm hoping someone can help. I'm
working on an application right now that allows people to add words to a
dictionary. When we display the alphabetical list, we do not want everything
listed under "T" because people led with "The". In
addition, because we are doing listings by letter, I have an index build on the
word column to speed up retrieval from the DB. I thought about two solutions to
the problem, and I'd like feedback and other possible solutions if possible.
1. Move "The" to the end of the entry and store it as "Word,
The"
2. Set a DB flag when "The" is the first word and remove
"The" from the entry.
Right now, I'm leaning towards option 2 because I can simply strip the leading
"The" from word searches and it should work pretty well. Plus it is
pretty easy to throw ", The" on to the end of the word if a flag is
present.
Your thoughts? Thanks!
|
| Post Reply
|
| Re: Handling "The" In Database Entries/Searches |
 |
Wed, 2 Apr 2008 04:45:09 +0000 |
Other ideas?
|
| Post Reply
|
| Re: Handling "The" In Database Entries/Searches |
 |
Wed, 2 Apr 2008 10:51:22 +0000 |
In the end, if you cannot intercept before the insert (e.g. in application code
or a stored procedure) then triggers are the only remaining approach.
|
| Post Reply
|
|
|
|
|
|
|
|
|
|