RE: [firebird-support] Evaluate "empty" string

2017-08-16 Thread 'bogdan mordicom' bog...@mordicom.si [firebird-support]
This is also possible

 

If (coalesce(terminal, '') <> '') then

 

Regards

 

Bogdan 

 

 

From: firebird-support@yahoogroups.com 
[mailto:firebird-support@yahoogroups.com] 
Sent: Wednesday, August 16, 2017 6:39 PM
To: firebird-support@yahoogroups.com
Subject: Re: [firebird-support] Evaluate "empty" string

 

  

May be this :

 

if (terminal<>'') and ( not  (terminal is null)) then

do something

 

With best regards

Michel

 

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

 





---
Ta e-pošta je bila pregledana z Avast protivirusnim programom.
https://www.avast.com/antivirus


Re: [firebird-support] Evaluate "empty" string

2017-08-16 Thread Jorge Andres Brugger jorge.brug...@gmail.com [firebird-support]
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 m...@lawinegevaar.nl
[firebird-support] :

> 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
>
>
> 
> Posted by: Mark Rotteveel 
> 
>
> ++
>
> 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
>
>
>
>


Re: [firebird-support] Evaluate "empty" string

2017-08-16 Thread Michel LE CLEZIO mlcvi...@yahoo.fr [firebird-support]
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 

Re: [firebird-support] Evaluate "empty" string

2017-08-16 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
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


[firebird-support] Evaluate "empty" string

2017-08-16 Thread Jorge Andres Brugger jorge.brug...@gmail.com [firebird-support]
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 .
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?
Thanks!


Re: [firebird-support] FIRST 1 of each iItemID

2017-08-16 Thread venussof...@gmail.com [firebird-support]
Thanks a lot Set.  Yes, I guess I was not able to explain my requirements 
clearly.

I think because the underlying is a view, vwPriceListHistory, the query you 
suggested is taking very long to run.  I will try your suggestion where there 
is a table rather than derived data

Kind regards
Bhavbhuti

Re: [firebird-support] Automation tools?

2017-08-16 Thread Kjell Rilbe kjell.ri...@marknadsinformation.se [firebird-support]













Re: [firebird-support] Re: FIRST 1 of each iItemID

2017-08-16 Thread venussof...@gmail.com [firebird-support]
Thanks Mark.  I went back to the cID as you suggested.  I added a 0 padded 
iItemID before the date and also padded the rest of the cID with 0 just like 
you wanted (though expanded) and your query works lightening fast.  I will be 
able to make practical use of it I am sure.

Thanks again for your patience with my question

Kind regards
Bhavbhuti