Hi all.

I'm trying to weed out garbage that comes from copying and pasting stuff from a web page.

Some of the data has spaces, but a *different* kind of space ... a char(160) kind ... I think ... I figured this out by copying the space character and pasting it into mysql thus:

select ascii(' ');

... where the space was pasted in.

So I'm using:

update tmp_AAPT_OnlineAnalyser_ChargeTypeSummary set Service_Number = replace( Service_Number, char(160), '' );

... but this returns:

Query OK, 0 rows affected (0.00 sec)
Rows matched: 313  Changed: 0  Warnings: 0

So it's not finding char(160) in Service_Number. If I try another way to get at the space character, I get a different result:

select ascii( right( Service_Number, 1 ) ) from tmp_AAPT_OnlineAnalyser_ChargeTypeSummary;

... gives me a big set of results, all 194 ( ie char(194) ). But when I compare both the characters:

select char(160), char(194);

... I get:

+-----------+-----------+
| char(160) | char(194) |
+-----------+-----------+
| <A0>         | <C2>         |
+-----------+-----------+

... and both the <A0> and <C2> results are in reverse video. The <A0> *looks* like the stuff I'm getting at the end of fields when I just do a select from the table in the MySQL command-line client, eg the 1st record has Service_Number:

0298437600<A0>
( <A0> is reversed ).

Lastly, maybe I shouldn't add this, but when I construct the space character from a Perl app running under Windows 2000:

my $space_character = chr(160);

and then insert it into the SQL:

my $sql = "update tmp_AAPT_OnlineAnalyser_ChargeTypeSummary set Service_Number = replace( Service_Number, '" . $space_character . "', '' )";

it works! But the *exact* same Perl code running on a Linux client fails ( doesn't update the field anyway ). It defies logic.

Who knows what's going on?

--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: [EMAIL PROTECTED]
website: http://www.nusconsulting.com.au

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to