May be this :
if (terminal<>'') and ( not (terminal is null)) thendo something
With best regardsMichel
Le Mercredi 16 août 2017 18h20, "Mark Rotteveel m...@lawinegevaar.nl
[firebird-support]" a écrit :
On 16-8-2017 17:53, Jorge Andres Brugger jorge.brug...@gmail.com
[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 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
#yiv9825789986 #yiv9825789986 -- #yiv9825789986ygrp-mkp {border:1px solid
#d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv9825789986
#yiv9825789986ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv9825789986
#yiv9825789986ygrp-mkp #yiv9825789986hd
{color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px
0;}#yiv9825789986 #yiv9825789986ygrp-mkp #yiv9825789986ads
{margin-bottom:10px;}#yiv9825789986 #yiv9825789986ygrp-mkp .yiv9825789986ad
{padding:0 0;}#yiv9825789986 #yiv9825789986ygrp-mkp .yiv9825789986ad p
{margin:0;}#yiv9825789986 #yiv9825789986ygrp-mkp .yiv9825789986ad a
{color:#ff;text-decoration:none;}#yiv9825789986 #yiv9825789986ygrp-sponsor
#yiv9825789986ygrp-lc {font-family:Arial;}#yiv9825789986
#yiv9825789986ygrp-sponsor #yiv9825789986ygrp-lc #yiv9825789986hd {margin:10px
0px;font-weight:700;font-size:78%;line-height:122%;}#yiv9825789986
#yiv9825789986ygrp-sponsor #yiv9825789986ygrp-lc .yiv9825789986ad
{margin-bottom:10px;padding:0 0;}#yiv9825789986 #yiv9825789986actions
{font-family:Verdana;font-size:11px;padding:10px 0;}#yiv9825789986
#yiv9825789986activity
{background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv9825789986
#yiv9825789986activity span {font-weight:700;}#yiv9825789986
#yiv9825789986activity span:first-child
{text-transform:uppercase;}#yiv9825789986 #yiv9825789986activity span a
{color:#5085b6;text-decoration:none;}#yiv9825789986 #yiv9825789986activity span
span {color:#ff7900;}#yiv9825789986 #yiv9825789986activity span
.yiv9825789986underline {text-decoration:underline;}#yiv9825789986
.yiv9825789986attach
{clear:both;display:table;font-family:Arial;font-size:12px;padding:10px
0;width:400px;}#yiv9825789986 .yiv9825789986attach div a
{text-decoration:none;}#yiv9825789986 .yiv9825789986attach img
{border:none;padding-right:5px;}#yiv9825789986 .yiv9825789986attach label
{display:block;margin-bottom:5px;}#yiv9825789986 .yiv9825789986attach label a
{text-decoration:none;}#yiv9825789986 blockquote {margin:0 0 0
4px;}#yiv9825789986 .yiv9825789986bold
{font-family:Arial;font-size:13px;font-weight:700;}#yiv9825789986
.yiv9825789986bold a {text-decoration:none;}#yiv9825789986 dd.yiv9825789986last
p a {font-family:Verdana;font-weight:700;}#yiv9825789986 dd.yiv9825789986last p
span {margin-right:10px;font-family:Verdana;font-weight:700;}#yiv9825789986
dd.yiv9825789986last p span.yiv9825789986yshortcuts
{margin-right:0;}#yiv9825789986 div.yiv9825789986attach-table div div a
{text-decoration:none;}#yiv9825789986 div.yiv9825789986attach-table
{width:400px;}#yiv9825789986 div.yiv9825789986file-title a, #yiv9825789986
div.yiv9825789986file-title a:active, #yiv9825789986
div.yiv9825789986file-title a:hover, #yiv9825789986 div.yiv9825789986file-title
a:visited {text-decoration:none;}#yiv9825789986 div.yiv9825789986photo-title a,
#yiv9825789986 div.yiv9825789986photo-title a:active, #yiv9825789986
div.yiv9825789986photo-title a:hover, #yiv9825789986
div.yiv9825789986photo-title a:visited {text-decoration:none;}#yiv9825789986
div#yiv9825789986ygrp-mlmsg #yiv9825789986ygrp-msg p a
span.yiv9825789986yshortcuts
{font-family:Verdana;font-size:10px;font-weight:normal;}#yiv9825789986
.yiv9825789986green {color:#628c2a;}#yiv9825789986 .yiv9825789986MsoNormal
{margin:0 0 0 0;}#yiv9825789986 o {font-size:0;}#yiv9825789986
#yiv9825789986photos div {float:left;width:72px;}#yiv9825789986
#yiv9825789986photos div div {border:1px solid
#66;min-height:62px;overflow:hidden;width:62px;}#yiv9825789986
#yiv9825789986photos div label
{color:#66;font-size:10px;overflow:hidden;text-align:center;white-space:nowrap;width:64px;}#yiv9825789986
#yiv9825789986reco-category {font-size:77%;}#yiv9825789986
#yiv9825789986reco-desc {font-size:77%;}#yiv9825789986 .yiv9825789986replbq
{margin:4px;}#yiv9825789986 #yiv9825789986ygrp-actbar div a:first-child
{margin-right:2px;padding-right:5px;}#yiv9825789986 #yiv9825789986ygrp-mlmsg
{font-size:13px;font-family:Arial, helvetica, clean, sans-serif;}#yiv9825789986
#yiv9825789986ygrp-mlmsg table {font-size:inherit;font:100%;}#