Re: [firebird-support] ASCII values

2018-03-10 Thread hugo.lar...@yahoo.com [firebird-support]
Thanks Mark.

Re: [firebird-support] ASCII values

2018-03-09 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2018-03-09 06:33, hugo.lar...@yahoo.com [firebird-support] wrote:
> I have a column char(2) where two ASCII values stored. For example
> 0011, 0001 are stored as (3,1).
> When I do a select I dont get any result because the result is not
> alphanumeric. 3 is ETX and 1 is NUL.
> I can get the values programmatically but I want to do bit comparison
> with sql query.
> Anyone might know how?

You can use hex literals[1] for that, eg

yourcolumn = x'0301'

This requires Firebird 2.5 or higher.

Be aware that 0x01 is not NUL, it is SOH (Start Of Heading), NUL is 
0x00.

Mark

[1]: 
https://firebirdsql.org/file/documentation/release_notes/html/en/2_5/rnfb25-dml.html#rnfb25-dml-hex


RE: [firebird-support] ASCII values

2018-03-09 Thread hugo.lar...@yahoo.com [firebird-support]
Many thanks András!

//ugo

RE: [firebird-support] ASCII values

2018-03-08 Thread Omacht András aoma...@mve.hu [firebird-support]
Hi Hugo!

If i understood well, you need this (tested on Fb2.5.8):

select * from table where field = ascii_char(3) || ascii_char(1);

or

select * from table where ascii_val(substring(field from 1 for 1) = 3 and 
ascii_val(substring(field from 2 for 1) = 1;

András


From: firebird-support@yahoogroups.com 
[mailto:firebird-supp...@yahoogroups..com]
Sent: Friday, March 9, 2018 6:33 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] ASCII values



Hello,

I have a column char(2) where two ASCII values stored. For example 0011, 
0001 are stored as (3,1).
When I do a select I dont get any result because the result is not 
alphanumeric. 3 is ETX and 1 is NUL.
I can get the values programmatically but I want to do bit comparison with sql 
query.
Anyone might know how?

Thx,
Hugo Larson





__ Information from ESET Mail Security, version of virus signature 
database 17027 (20180309) __

The message was checked by ESET Mail Security.
http://www.eset.com


[Non-text portions of this message have been removed]