Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Database Server Software > MySQL > doing a ascci to hex cnversion ???

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-03-02, 08:04
tag tag is offline
Registered User
 
Join Date: Nov 2001
Location: South Africa
Posts: 33
doing a ascci to hex cnversion ???

HI ALL.

Is there a way of doing a ascii to hex conversion in a select statement ??

I have a table that I need to search for a particular string :

select * from table where col1 like '%searching%';

but col1 is stored in the database as HEX ????

Please help
Thanks
Tonino
Reply With Quote
  #2 (permalink)  
Old 12-03-02, 23:22
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
There is a hex() function and a conv() function you can use.
Reply With Quote
  #3 (permalink)  
Old 12-04-02, 01:01
tag tag is offline
Registered User
 
Join Date: Nov 2001
Location: South Africa
Posts: 33
Hi,

thanks for the info - BUT I have mysql ver 3.23.52-r1

it does not seem to work on this version ?? only on 4.04. Is there a way to get it to work on 3.23.52-r1 ?????

Thanks
Tonino
Reply With Quote
  #4 (permalink)  
Old 12-07-02, 00:36
rnealejr rnealejr is offline
Registered User
 
Join Date: Feb 2002
Posts: 2,232
From the documentation that I have both of these functions were introduced in version 3.22.4.
Reply With Quote
  #5 (permalink)  
Old 12-07-02, 05:43
snobscure snobscure is offline
Registered User
 
Join Date: Dec 2002
Posts: 2
Interesting:

grotum:~$ echo 'select version(); SELECT HEX("abc");' | mysql -N -h$HOST -u$USER -p$PASSWORD foo1
3.23.32
0
grotum:~$

Note that the HEX example is straight from the MySQL manual:

http://www.mysql.com/doc/en/String_f...s.html#IDX1160

and is expected to return an, er, useful value:

Quote:
mysql> SELECT HEX("abc");
-> 616263
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On