Subject Re: [firebird-support] Evaluate "empty" string
Author Jorge Andres Brugger
That's right! I was focusing in the wrong place! So stupid me!
Thanks a lot (also to Michel).


2017-08-16 13:20 GMT-03:00 Mark Rotteveel mark@... [firebird-support] <firebird-support@yahoogroups.com>:
On 16-8-2017 17:53, Jorge Andres Brugger jorge.brugger@...
[firebird-support] wrote:
> Hello all.
> 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?

An empty string is not null, so even though
(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


------------------------------ ------
Posted by: Mark Rotteveel <mark@...>
------------------------------ ------

++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++ ++++++

Visit http://www.firebirdsql.org and click the Documentation item
on the main (top) menu.  Try FAQ and other links from the left-side menu there.

Also search the knowledgebases at http://www.ibphoenix.com/ resources/documents/

++++++++++++++++++++++++++++++ ++++++++++++++++++++++++++++++ ++++++
------------------------------ ------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ firebird-support/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ firebird-support/join
    (Yahoo! ID required)

<*> To change settings via email:
    firebird-support-digest@ yahoogroups.com
    firebird-support-fullfeatured@ yahoogroups.com

<*> To unsubscribe from this group, send an email to:
    firebird-support-unsubscribe@ yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/ us/yahoo/utos/terms/