Subject Re: [firebird-support] only for numerics...
Author The Wogster
Rony Cesana wrote:
>>Creating database systems iteratively is NOT silly. It's only silly
>>if you get to the point where you are, discover your mistake, and try
>>to solve it by creating a Band-Aid (like writing a UDF to extract
>>numeric meaning from the contents of an ad hoc string).
>
>
> What if I knew this and my clients didn't?
> What if there wasn't any chance of letting them accept that they cannot
> extract information after they make a lossy translation?
>
> The choice would than be: lose clients, using a cast-like operator if it, by
> chance, existed, or writing a UDF.
>
> The point is here that I'm not designing a DB, and implementing a general
> tool to generate data-entry programs for dump people.
>
> When IBExpert was designed, and particularly its filter features, an
> assumption was made on the understanding of the SQL implict overloading of
> the "<" operator.
> "<" : char(n) x char(m) -> boolean
> "<" : varchar(n) x varchar(m) -> boolean
> "<" : integer x integer -> boolean
> are all different functions to me, as we all remember from our days of
> non-playing basketball.
>
> I'm not too surprised of hearing about "1976" < "876" whereas 876 < 1976,
> and I'm not assuming any of you is ignorant enough to be surprised either.
>
> Unfortunately the users of my system are going to be History of Art
> Academics (there you go... live in Italy and try and be a programmer!), who
> might not understand this.
> However they might fill in all that sort of heterogeneous data in a varchar,
> and still accept a numerical comparing criterium to return sensible data
> only for... numbers!

You don't have a database problem, you have a translation problem, the
data needs to be stored specifically, in other words the database needs
exact values. That's a given, and most people will allow for that.

The problem you have is that the user types in 'before 1976' SQL wants
'< 1976'. Your software needs to translate between the two. Of course
the database doesn't care if you have typed 'before' or the Italian
word/phrase for 'before'.


W