Re: triming white space from a TEXT column

2002-02-13 Thread Richard Reina



 I am trying to trim both leading and trailing whitespace from a TEXT 
 column in my SELECT query.  I found the TRIM() command in the manual, 
 however, I can't get it to act upon a column name instead of an 
 actual string.  Can anyone help?


 If you just say TRIM(col_name) it will return the trimmed column value,
 but it won't change the column itself.  Try updating the column to its
 trimmed value:

 UPDATE tbl_name SET col_name = TRIM(col_name);



I tried both ideas and neither one removed the white spaces.  arrr! :-(




 Thanks,

 Richard







-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: triming white space from a TEXT column

2002-02-12 Thread Keith C. Ivey

On 7 Feb 2002, at 8:20, Richard Reina wrote:

 I tried both ideas and neither one removed the white spaces.  arrr!
 :-(

Unfortunately TRIM doesn't remove whitespace (spaces, tabs, carriage
returns, linefeeds), as it does in some programming languages.  It 
just removes spaces, unless you specify another character for it to 
remove instead.  Maybe your value has CR and/or LF at the end?

Fodder for the idiotic filter: sql,query

-- 
Keith C. Ivey [EMAIL PROTECTED]
Washington, DC

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: triming white space from a TEXT column

2002-02-11 Thread Paul DuBois

At 16:17 -0800 2/6/02, Richard Reina wrote:
I am trying to trim both leading and trailing whitespace from a TEXT 
column in my SELECT query.  I found the TRIM() command in the 
manual, however, I can't get it to act upon a column name instead of 
an actual string.  Can anyone help?

If you just say TRIM(col_name) it will return the trimmed column value,
but it won't change the column itself.  Try updating the column to its
trimmed value:

UPDATE tbl_name SET col_name = TRIM(col_name);


Thanks,

Richard


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: triming white space from a TEXT column

2002-02-07 Thread Richard Reina



 I am trying to trim both leading and trailing whitespace from a TEXT 
 column in my SELECT query.  I found the TRIM() command in the manual, 
 however, I can't get it to act upon a column name instead of an 
 actual string.  Can anyone help?


 If you just say TRIM(col_name) it will return the trimmed column value,
 but it won't change the column itself.  Try updating the column to its
 trimmed value:

 UPDATE tbl_name SET col_name = TRIM(col_name);



I tried both ideas and neither one removed the white spaces.  arrr! :-(




 Thanks,

 Richard







-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: triming white space from a TEXT column

2002-02-07 Thread Keith C. Ivey

On 7 Feb 2002, at 8:20, Richard Reina wrote:

 I tried both ideas and neither one removed the white spaces.  arrr!
 :-(

Unfortunately TRIM doesn't remove whitespace (spaces, tabs, carriage
returns, linefeeds), as it does in some programming languages.  It 
just removes spaces, unless you specify another character for it to 
remove instead.  Maybe your value has CR and/or LF at the end?

Fodder for the idiotic filter: sql,query

-- 
Keith C. Ivey [EMAIL PROTECTED]
Washington, DC

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: triming white space from a TEXT column

2002-02-06 Thread Paul DuBois

At 16:17 -0800 2/6/02, Richard Reina wrote:
I am trying to trim both leading and trailing whitespace from a TEXT 
column in my SELECT query.  I found the TRIM() command in the 
manual, however, I can't get it to act upon a column name instead of 
an actual string.  Can anyone help?

If you just say TRIM(col_name) it will return the trimmed column value,
but it won't change the column itself.  Try updating the column to its
trimmed value:

UPDATE tbl_name SET col_name = TRIM(col_name);


Thanks,

Richard


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php