If you're going to use SQL, why would you want to shove the whole thing
into a single field? You'd have to use wildcard searches to find values.
Why not set up a separate table with 100 recoreds, each record having
just one two character field containing your values? Then you don't get
the overlap, you don't have to use delimiters, and the database engine
can be quite efficient in storing the values.
-----Original Message-----
From: midrange-l-bounces@xxxxxxxxxxxx
[mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of James Lampert
Sent: Thursday, January 15, 2009 5:38 PM
To: 'Midrange Systems Technical Discussion'
Subject: SQL searching in a field that has a series of codes
Postulate a field, containing a series of codes representing multiple
selections of a drop-down list box.
These codes are, for argument's sake, two-digit numbers, and let us
assume that the whole gamut from 00 to 99 is a valid value.
Obviously, if we separate the codes with some delimiter that isn't a
valid part of any code (e.g., a space), SQL can easily tell whether the
field contains any code we're looking for.
But now let us assume that we're being very stingy with space, and
stringing the codes together without any delimiters. In other words, if
our selections are 01, 02, 03, and 04, the field looks like "01020304"
in the file.
Searches for 01, 02, 03, and 04 would all hit, but so would searches for
10, 20, and 30. Is there a practical way to prevent the spurious hits,
other than to bite the bullet and allow space for delimiters?
--
James H. H. Lampert
Touchtone Corporation
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxx Before posting, please take a
moment to review the archives at
http://archive.midrange.com/midrange-l.
As an Amazon Associate we earn from qualifying purchases.