Re: keeping blanks out of the data
Posted in 1992
In article 24112@advtech.uswest.com, yslas@riverauswest.com ( Rob Yslas) writes:
>This is probably a dumb question but I don't have an sql/preform manual for this
>information. I am using the standard engine and would like to know if there is a
>way for me to keep the blanks at the end of a form from being saved (attribute).
>The user likes to space bar for deletion of mistakes rather then using ^d.
>I would also like to know if there is an easy way to remove existing blanks from
>the end of fields in the database or set fields with only blanks to a null. Any
>help is appreciated.
>
>Thanks in advance,
>Rob Yslas
>
>Disclaimer - These questions are my own and do not reflect any knowledge, actual
>or implied, of the employing organization.
>
>--
>yslas@advtech.uswest.com
>Thanks
Unless you are using On-Line and var-chars, it shouldn't really matter, since
"Hi" and "Hi " are stored the same way, the only time it would make a difference
is that there is a difference between NULL and " ".
As to clearing blank fields to NULL, I would suggest an UPDATE similar to this:
UPDATE x SET cola = NULL
WHERE cola MATCHES " "
You should probably play with that to see what the exact syntax you need is. Be aware
that storing as NULL is not going to change the size of you database files...CISAM
files are fixed length records, a char(20) is going to take up 20 bytes, regardless
of what is stored in those bytes.
don simon
Could be wrong, Could be right, Could be I didn't sleep last night.