Re: [firebird-support] convert a string to a number in a where clause - without errors

2018-01-16 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2018-01-16 09:52, Rustam rusta...@ukr.net [firebird-support] wrote:
> I think better way is to control input on client.
> If this is impossible you can try "spike": write selectable stored
> procedure with exception handler "when any do ..."

Or use a Firebird 3 Function.

Mark


Re: [firebird-support] convert a string to a number in a where clause - without errors

2018-01-16 Thread Svein Erling Tysvær setys...@gmail.com [firebird-support]
I tried something very similar to

select * from daten where (case when sn similar to '[0-9]+' then cast
(sn as integer) else null end ) > 0

and it worked in Firebird 2.5.

Though I might have considered rewriting it

select * from daten where cast( iif( sn similar to '[[:DIGIT:]]+', sn, null
) as integer) > 0

Set


[firebird-support] convert a string to a number in a where clause - without errors

2018-01-16 Thread Rustam rusta...@ukr.net [firebird-support]
I think better way is to control input on client.
If this is impossible you can try "spike": write selectable stored procedure 
with exception handler "when any do ..."