jose isaias cabrera <cabr...@wrc.xerox.com>
wrote: 
> I would like to trim a column from all white spaces.  I know how to
> do it programmatically, but I would like to do it right to the DB. Is
> this a possibility?

update mytable set mycolumn=trim(mycolumn);

> Also, how to I trim specific characters?  Say tab, or char(0) or
> char(X), etc?  I know that I do trim(vEmail,Y), but how do I
> represent tab? or newline? etc.?

If you do it in your program, just put those characters in the query string or 
bound parameter string, using facilities of your programming language. E.g. in 
C that would be something like "trim(vEmail, ' \t\n')".

If you do it manually from, say, command line interface, you can do this:

update mytable set mycolumn=trim(mycolumn, cast(X'20090A' as text));

20 being the ASCII code of space, 09 of tab and 0A of line feed.

Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to