Hello Mark,

>>>>> 0x40 = 64, you're basically sayg c = 64, why do you think it should 
>>>>> not
>>>>> be converted to '64' ?
>>>>
>>>>      Perhaps, because it is a binary blob, not text one.
>>>>
>>>
>>> Numbers are converted to string, just like when you would do this with a
>>> VARCHAR or CHAR.
>>
>>
>> When I use:
>> c = 0x414243;
>>
>> I get:
>> 4276803 in characters (hex value 34 32 37 36 38 30 33).
>
>0x414243 is for hexadecimal integer values, in base 10 it is 4276803.
>When you assign the integer to a blob, it is converted to string, so
>0x414243 => 4276803 => '4276803' => blob with bytes 0x34 0x32 0x37 0x36
>0x38 0x30 0x33.
>
>> Why, with a binary blob, is the value returned as characters?
>
>Because the integer was converted to string before assigning to the blob.
>
>I think you are confusing 0x... (hexadecimal integers) with x'...'
>(hexadecimal binary strings).
>
>0x...:
>http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd25-hexnumerals.html
>x'...':
>http://www.firebirdsql.org/file/documentation/reference_manuals/reference_material/html/langrefupd25-hexbinstrings.html

Ah, now I get the difference! Thanks.

I wonder if converting for binary blobs makes sense though.

I've tried this after I've tried the same thing in MySQL, see:
http://dev.mysql.com/doc/refman/5.0/en/hexadecimal-literals.html

MySQL requires an explicit cast to number for it to be treated that way and 
for blobs,
it's just binary. I guess this helped to get me confused.


Thanks.


With regards,

Martijn Tonies
Upscene Productions
http://www.upscene.com

Download Database Workbench for Oracle, MS SQL Server, Sybase SQL
Anywhere, MySQL, InterBase, NexusDB and Firebird!





------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to