List:General Discussion« Previous MessageNext Message »
From:Mikko Noromaa Date:July 8 2003 11:37pm
Subject:RE: "select * from table where field=hex" doesnt work
View as plain text  
Hi,

Your solution converts the binary field to a string and then compares two
strings. You should get rid of any conversion problems by comparing the
values as binary data:

SELECT * FROM table1 WHERE field1 = BINARY 0x61006200630064000000;

--

Mikko Noromaa (mikkon@stripped)
- SQL in Excel, check out ExcelSQL! - see http://www.excelsql.com -
 

> -----Original Message-----
> From: Koh Swee Meng [mailto:swee_meng@stripped] 
> Sent: Tuesday, July 08, 2003 6:07 AM
> To: mysql@stripped
> Subject: Re: "select * from table where field=hex" doesnt work
> 
> 
> oh, i found the solution for this,
> by doing "SELECT * FROM table1 WHERE STRCMP(field1,
> 0x61006200630064000000)=0" will work as expected, so no need 
> to worry that
> character %(ASCII 25) will cause any problem.
> 
> 
> Regards,
> Koh Swee Meng
> 
> 
> ----- Original Message -----
> From: "Koh Swee Meng" <swee_meng@stripped>
> To: <mysql@stripped>
> Sent: Tuesday, July 08, 2003 10:55 AM
> Subject: "select * from table where field=hex" doesnt work
> 
> 
> > i inserted a new record with this SQL
> > "INSERT INTO table1(field1) VALUES(0x61006200630064000000)"
> > type of table1.field1 is tinyblob.
> >
> > to retrieve the record, i tried SQL belows,
> > 1) SELECT * FROM table1 WHERE field1 = 0x61006200630064000000;
> > 2) SELECT * FROM table1 WHERE field1 LIKE 0x61006200630064000000;
> > 1st SQL found nothing, but the 2nd SQL found the exact record.
> >
> > Is this a bug? I am using mysql 3.23.41 in Linux.
> >
> >
> > Regards,
> > Koh Swee Meng
> >
> >
> > --
> > MySQL General Mailing List
> > For list archives: http://lists.mysql.com/mysql
> > To unsubscribe:
> http://lists.mysql.com/mysql?unsub=1
> >
> >
> 
> 

Thread
Error 1044 & Error 2003 on 4.0.13 and RH9Kevin H. Phillips4 Jul
  • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Victoria Reznichenko4 Jul
    • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Kevin H. Phillips4 Jul
    • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Nils Valentin7 Jul
      • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Nils Valentin7 Jul
        • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Kevin H. Phillips7 Jul
          • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Nils Valentin7 Jul
            • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Kevin H. Phillips8 Jul
              • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Nils Valentin8 Jul
                • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Kevin H. Phillips8 Jul
                  • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Nils Valentin8 Jul
                    • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Kevin H. Phillips8 Jul
                    • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Kevin H. Phillips8 Jul
              • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Victoria Reznichenko8 Jul
        • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Paul DuBois9 Jul
          • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Nils Valentin9 Jul
            • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Kevin H. Phillips10 Jul
              • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Nils Valentin10 Jul
                • Re: Error 1044 & Error 2003 on 4.0.13 and RH9Kevin H. Phillips10 Jul
  • "select * from table where field=hex" doesnt workKoh Swee Meng8 Jul
    • Re: "select * from table where field=hex" doesnt workNils Valentin8 Jul
      • Re: "select * from table where field=hex" doesnt workPaul DuBois9 Jul
        • Re: "select * from table where field=hex" doesnt workNils Valentin9 Jul
  • Re: "select * from table where field=hex" doesnt workKoh Swee Meng8 Jul
    • RE: "select * from table where field=hex" doesnt workMikko Noromaa8 Jul
Re: Error 1044 & Error 2003 on 4.0.13 and RH9Nils Valentin8 Jul