Subject | Re: [firebird-support] Evaluate "empty" string |
---|---|
Author | Mark Rotteveel |
Post date | 2017-08-16T16:20:47Z |
On 16-8-2017 17:53, Jorge Andres Brugger jorge.brugger@...
[firebird-support] wrote:
(CHAR_LENGTH(trim(terminal))>0) might be false, (terminal is not null)
is true, so the IF evaluates to true and is executed.
Maybe you meant AND instead of OR?
--
Mark Rotteveel
[firebird-support] wrote:
> Hello all.An empty string is not null, so even though
> I need to evaluate if one SP varchar parameter is "not empty". I´m using:
> if (((CHAR_LENGTH(trim(terminal))>0) or (terminal is not null)) then <do
> something>.
> If I send '' (empty string) as parameter content, the expression
> evaluates to true (I´m expecting to get a false).
> What am I doing wrong?
(CHAR_LENGTH(trim(terminal))>0) might be false, (terminal is not null)
is true, so the IF evaluates to true and is executed.
Maybe you meant AND instead of OR?
--
Mark Rotteveel