Results 1 to 5 of 5
  1. #1
    Join Date
    Nov 2001
    Location
    South Africa
    Posts
    33

    Unanswered: 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

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    There is a hex() function and a conv() function you can use.

  3. #3
    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

  4. #4
    Join Date
    Feb 2002
    Posts
    2,232
    From the documentation that I have both of these functions were introduced in version 3.22.4.

  5. #5
    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:

    mysql> SELECT HEX("abc");
    -> 616263

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •