[thelist] trimming db output (was: ASP question: Req...)
MRC
webmaster at equilon-mrc.com
Thu Nov 29 18:33:36 CST 2001
rudy,
You speak as a Prophet of the Oracle of SQL (or of SQL Server, depending
on one's platform), dispensing much wisdom in few words...
:)
> okay, i appreciate that this is a "defensive programming" strategy, and in
> that sense it's good advice, but sheesh, the time to do the trimming, in
> fact the time to do *all* edits to ensure clean data, is on **input**
>
> if you do it on output you'll have redundant code all over the friggin
> place
Assuming, of course, that you have (and have had) complete control over
data input. Ideally true, but not always true in the real world...
> james:
>
> > varFieldOne = Trim(objRS("FieldOne") & "")
> >
> > This, of course, forces at least an empty string and avoids any
> > headaches from nulls. Comments? Counter-suggestions?
>
> this may work in ASP, but if you try the same approach in sql you will get
> burned
>
> a null concatentated with anything is still a null
My suggestion was strictly ASP-oriented. From my experience, SQL won't
allow implicit data conversions. Isn't this so?
James Aylard
More information about the thelist
mailing list