On Mon, Jan 07, 2008 at 03:59:52PM +0000, [EMAIL PROTECTED] wrote:
> If you want to trim whitespace on insert, why not just say so:
>
> INSERT INTO table VALUES(trim(?),trim(?),trim(?));
>
> Instead of:
>
> INSERT INTO table VALUES(?,?,?);
Yes, yes - quite right. And exactly because of this I "invented" a feature
I'm suggesting now. In my practice, *always* I wanted to insert values
stripped out of spaces. So, when I know, that now and in the future I want
always to have these strings stripped out of spaces, why not have a
possibility to make it default behaviour of the SQL-engine itself, just by
using one "pragma"?
1. It'll make my code shorter.
2. It'll make my life easier. ;)
3. It'll make the inserting operation faster, than using separate trim-s for
every value, at SQL level.
4. It can be, as I wrote, additional safety, f.e. if I forgot to set trim
anywhere in the application.
5. In some simpler cases I could even omit entry check knowing, that strings
will be trimmed by SQLite anyway.
6. It's a feature "in the spirit" of the one, which allows to insert strings
containing single quotes, without a need to escape them first (very
convenient! :)
7. It won't hurt anybody; as I wrote, it would be an option. But I'm pretty
sure, many can (and will) appreciate that. Never seen that in any other
database server (or engine).
--
pozdrawiam / regards
Zbigniew Baniewski
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------