On 26-9-2014 18:55, Martijn Tonies (Upscene Productions) wrote:
>>>> 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

Mark
-- 
Mark Rotteveel

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