Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 4 of 4 total
Thread Trim in dbisam in sql
Fri, Dec 19 2008 2:05 AMPermanent Link

Hiba Hable
Hello,

What is the syntax of the trim function in sql in dbisam? I want to trim a feild in datatable from both sides.

Thank you

Hiba
Fri, Dec 19 2008 4:10 AMPermanent Link

"Eduardo [HPro]"
Hiba

According with DBISAM help.

TRIM Removes repetitions of a specified character from the left, right, or
both sides of a string.
LTRIM Removes any leading space characters from a string.

RTRIM Removes any trailing space characters from a string.

Eduardo

Fri, Dec 19 2008 5:30 AMPermanent Link

Hiba Hable
Hello,

How can i write the sql statment if i want to trim a column?

thx
Fri, Dec 19 2008 6:28 AMPermanent Link

Fernando Dias

Team Elevate Team Elevate

Hiba,

If what you mean is to trim all the existing values in a column, then:
   UPDATE <tableName> SET <ColumnName> = TRIM(BOTH ' ' FROM <ColumnName>)

or, if the type of the column is VARCHAR :
   UPDATE <tableName> SET <ColumnName> = LTRIM(<ColumnName>)
because in that case you only need to remove the leading spaces  - trailing
spaces are removed automatically for VARCHAR columns.


--
Fernando Dias
[Team Elevate]

Image