[firebird-support] COALESCE

2016-03-19 Thread Tim Ward t...@telensa.com [firebird-support]
So I'm getting errors when there's a call to COALESCE with only a single parameter. (Why would we write code like that? - because nobody thought to spot it as a special case in our query generation code, perhaps.) So what does the Firebird book say? - well, my copy appears to say COALESCE (valu

[firebird-support] coalesce

2015-03-25 Thread 'checkmail' check_m...@satron.de [firebird-support]
Hey everyone, one short question, why is the Result of coalesce(:variableVarchar(10),'NULL') not ,NULL' but rather 'NULL ' with blanks from varchar(10) length? Thank you. Best regards. Olaf

RE: [firebird-support] coalesce

2015-03-25 Thread 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
> one short question, why is the Result of > coalesce(:variableVarchar(10),'NULL') not ,NULL' but rather 'NULL  ' with > blanks from varchar(10) length? What tool/application are you using to evaluate the result? As Dmitry and Mark have already pointed out, the result should be a VarChar(10

AW: [firebird-support] coalesce

2015-03-25 Thread 'checkmail' check_m...@satron.de [firebird-support]
Okay, Thanks @ll! It was in fact a char instead a varchar item. Von: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Gesendet: Mittwoch, 25. März 2015 22:11 An: firebird-support@yahoogroups.com Betreff: RE: [firebird-support] coalesce > one sh

[firebird-support] Coalesce can't be optimised?

2014-09-03 Thread Tim Ward t...@telensa.com [firebird-support]
I've got a query like: SELECT ... FROM TBL WHERE COALESCE( FIELD1, FIELD2 ) = 12345 where FIELD2 is the primary key and FIELD1 also has an index (in fact it's a foreign key back to FIELD2). This results in a table scan. However expanding the COALESCE by hand: SELECT ... FROM TBL WHERE ( FIELD1

[firebird-support] COALESCE() + CAST() converts timestamp format

2014-05-10 Thread venussof...@gmail.com [firebird-support]
Hi all I have the following in my SELECT statement COALESCE(CAST(tPB.dBillDt AS TIMESTAMP), '') AS tDocDt The COALESCE() converts the CAST()ed TIMESTAMP to ANSI standard 2014-05-03 00:00:00. CAST(COALESCE(tPB.dBillDt, '') AS TIMESTAMP) AS tDocDt The CAST() converts the COALESC

[firebird-support] coalesce bug in fb 3.0 rc2?

2016-03-08 Thread 'Checkmail' check_m...@satron.de [firebird-support]
Hello, in the further version of firebird I can execute the following and get the real value of m (exists in tlager_sum) select a.teilenr, a.bezeichnung, a.minb, coalesce(b.menge,0) as m, a.typ from tteile a left join tlager_sum b on (a.teilenr = b.teilenr) where ((a.minb > coalesce(b.

Re: [firebird-support] COALESCE() + CAST() converts timestamp format

2014-05-12 Thread Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support]
Hi Bhavbhuti, I do not know the exact solution, but I'd say: > COALESCE(CAST(tPB.dBillDt AS TIMESTAMP), '') AS tDocDt converts timestamp inside servers environment to a string - the returning client receives a string and does not know about it's datatype - yet does not a apply specific translati

Re: [firebird-support] COALESCE() + CAST() converts timestamp format

2014-05-12 Thread Venus Software Operations venussof...@gmail.com [firebird-support]

RE: [firebird-support] COALESCE() + CAST() converts timestamp format

2014-05-13 Thread Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]
By the way, Bhavbhuti, CAST(COALESCE(tPB.dBillDt, '') AS TIMESTAMP) AS tDocDt will fail if tPB.dBillDt is null since '' cannot be converted to a timestamp (it is neither a timestamp nor null). Set

Re: [firebird-support] COALESCE() + CAST() converts timestamp format

2014-05-13 Thread Venus Software Operations venussof...@gmail.com [firebird-support]

RE: [firebird-support] COALESCE() + CAST() converts timestamp format

2014-05-13 Thread Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]
>Thanks Svein.  Would you suggest I double COALESCE it?  I think it will be an >overkill and I might end up with an ANSI datetime again.  >Or should I not COALESCE it at all?  I wanted a blank date time in case of a >NULL for tBillDt and if there is a date in tBillDt I need >it for date calcula

Re: [firebird-support] COALESCE() + CAST() converts timestamp format

2014-05-13 Thread Venus Software Operations venussof...@gmail.com [firebird-support]

Re: [firebird-support] COALESCE() + CAST() converts timestamp format

2014-05-13 Thread W O sistemas2000profesio...@gmail.com [firebird-support]
Svein, Bhavbhuti has a background as a Visual FoxPro developer and in that language exist empty dates. Probably is the reason why he had casted an empty string as a timestamp. The same thing had happened to me when I was learning SQL. Greetings. Walter. On Tue, May 13, 2014 at 4:02 AM, Svein

Re: [firebird-support] coalesce bug in fb 3.0 rc2?

2016-03-08 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2016-03-08 16:18, 'Checkmail' check_m...@satron.de [firebird-support] wrote: > Hello, > > in the further version of firebird I can execute the following and > get > the real value of m (exists in tlager_sum) > > select a.teilenr, a.bezeichnung, a.minb, coalesce(b.menge,0) as m, > a.typ > > fr

AW: [firebird-support] coalesce bug in fb 3.0 rc2?

2016-03-08 Thread 'Checkmail' check_m...@satron.de [firebird-support]
irebird-support@yahoogroups.com Betreff: Re: [firebird-support] coalesce bug in fb 3.0 rc2? On 2016-03-08 16:18, 'Checkmail' check_m...@satron.de <mailto:check_m...@satron.de> [firebird-support] wrote: > Hello, > > in the further version of firebird I can execute the fo

AW: [firebird-support] coalesce bug in fb 3.0 rc2?

2016-03-08 Thread 'Checkmail' check_m...@satron.de [firebird-support]
: [firebird-support] coalesce bug in fb 3.0 rc2? Hell Mark, I would get all material, where the minimum inventory amount iss maller the the inventory amount. Tlager_sum contains the inventory amount, tteile.minb the theoretical minimum amount it should be. Now, the simplified

Re: AW: [firebird-support] coalesce bug in fb 3.0 rc2?

2016-03-08 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 2016-03-09 7:57, 'Checkmail' check_m...@satron.de [firebird-support] wrote: > Hello again, > > sorry, outlook corrects me in German. At the moment, I have no > sulution for the problem. Anything ideas? I think you should create a sample database to demonstrate this problem, and create a ticke

Re: AW: [firebird-support] coalesce bug in fb 3.0 rc2?

2016-03-09 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
Hello, > sorry, outlook corrects me in German. At the moment, I have no sulution > for the problem. Anything ideas? Query: SELECT a.teilenr, a.bezeichnung, a.minb, coalesce(b.menge,0) as m, a.typ FROM tteile a left join tlager_sum b on (a.teilenr = b.teilenr) WHERE ((a.minb > coalesce(

AW: AW: [firebird-support] coalesce bug in fb 3.0 rc2?

2016-03-09 Thread 'Checkmail' check_m...@satron.de [firebird-support]
sum. Thanks Von: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Gesendet: Mittwoch, 9. März 2016 09:04 An: firebird-support@yahoogroups.com Betreff: Re: AW: [firebird-support] coalesce bug in fb 3.0 rc2? Hello, > sorry, outlook corrects me in German.

Re: AW: AW: [firebird-support] coalesce bug in fb 3.0 rc2?

2016-03-09 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
Hello, > your are right. But in FB 3, it will be handled different. > I need the left join tlager_sum, because I’d like to have all records too > there no records in tlager_sum. > But in this case I get now in fb 3 the tteile.teilenr clean without the > amaount of tlager_sum (the a.minb is grea

AW: AW: AW: [firebird-support] coalesce bug in fb 3.0 rc2?

2016-03-10 Thread 'Checkmail' check_m...@satron.de [firebird-support]
mount (minb) and should not be displayed (like in firebird 2.5, 2.1, 2.0) Thanks Von: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Gesendet: Mittwoch, 9. März 2016 13:25 An: firebird-support@yahoogroups.com Betreff: Re: AW: AW: [firebird-support] coalesce bug

Re: AW: AW: AW: [firebird-support] coalesce bug in fb 3.0 rc2?

2016-03-10 Thread 'Arno Brinkman' fbsupp...@abvisie.nl [firebird-support]
Hi, Thank you for providing a script, this is much easier comparing. I can now reproduce the error you get. Please enter a ticket with this script into the tracker, so they can fix this issue. Enter these both queries, so they can quickly find the bug: The query with the wrong results: SELEC