Re: [firebird-support] Reading unnecessary records

2014-04-07 Thread Tim Ward
On 04/04/2014 23:36, Alexandre Benson Smith wrote: If you don't need a particular table information, having it on the view is useless... So if you have the need of a distinct rescult set only one view would not handle this. So the on the fly generated query is not better than the view

Re: [firebird-support] Metadata about views

2014-04-07 Thread Thomas Beckmann
Maybe, I've completly mistaken the original question, but isn't select r.RDB$VIEW_SOURCE from RDB$RELATIONS r where r.RDB$VIEW_SOURCE is not null simply returning the underlying query - with every field? Am 07.04.2014 11:32, schrieb Svein Erling Tysvær: CREATE OR ALTER VIEW SALDO_UMOWY(

RE: [firebird-support] Metadata about views

2014-04-07 Thread Svein Erling Tysvær
Maybe, I've completly mistaken the original question, but isn't select r.RDB$VIEW_SOURCE from RDB$RELATIONS r where r.RDB$VIEW_SOURCE is not null simply returning the underlying query - with every field? Sure, it would in many cases return the query used in the view (I think it is possible

[firebird-support] order by

2014-04-07 Thread checkmail
Hello, I've a litte question. Now I can order by the column number, order by 1. Can I set this information with a variable? Dim k as integer = 1; Order by :k? Thanks

Re: [firebird-support] order by

2014-04-07 Thread Andrea Raimondi
I don't think so. And anyway, you should never be using an order by number - unless there is really no way around it, in my opinion. A On Mon, Apr 7, 2014 at 11:47 AM, checkmail check_m...@satron.de wrote: Hello, I've a litte question. Now I can order by the column number, order by 1.

Re: [firebird-support] order by

2014-04-07 Thread Tim Ward
On 07/04/2014 12:40, Andrea Raimondi wrote: And anyway, you should never be using an order by number - unless there is really no way around it, in my opinion. When people make statements like that it would be really helpful if they were to say *why* they are of this opinion, otherwise the

Re: [firebird-support] order by

2014-04-07 Thread Andrea Raimondi
I am of this opinion because SQL scripts change and what is today column number 2 may become column number 14 two days later. This, in turn, leads to potential problems because you think it's ordering by something whereas instead it's ordering by something else. A On Mon, Apr 7, 2014 at 2:58

Re: [firebird-support] order by

2014-04-07 Thread Tim Ward
Thanks. Knowing this reasoning, one can then use one's judgement in comparing this reason against a desire to avoid repeating a long complex expression which could also lead to a maintenance risk. On 07/04/2014 15:02, Andrea Raimondi wrote: I am of this opinion because SQL scripts change and

Re: [firebird-support] order by

2014-04-07 Thread Andrea Raimondi
To avoid those cases, I will usually wrap the long and complex expression in an outer select giving it an intuitive column name. It does not work in *all* cases, but it does work in most. A On Mon, Apr 7, 2014 at 3:05 PM, Tim Ward t...@telensa.com wrote: Thanks. Knowing this reasoning, one

Re: [firebird-support] Metadata about views

2014-04-07 Thread Ann Harrison
On Mon, Apr 7, 2014 at 6:04 AM, Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no wrote: Maybe, I've completly mistaken the original question, but isn't select r.RDB$VIEW_SOURCE from RDB$RELATIONS r where r.RDB$VIEW_SOURCE is not null simply returning the underlying

Re: [firebird-support] order by

2014-04-07 Thread Ann Harrison
On Mon, Apr 7, 2014 at 6:47 AM, checkmail check_m...@satron.de wrote: I've a litte question. Now I can order by the column number, order by 1. Can I set this information with a variable? Dim k as integer = 1; Order by :k? You can do the equivalent with an EXECUTE STATEMENT.With the

AW: [firebird-support] order by

2014-04-07 Thread checkmail
Thanks @ll J Von: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Im Auftrag von Ann Harrison Gesendet: Montag, 7. April 2014 17:30 An: firebird-support@yahoogroups.com Betreff: Re: [firebird-support] order by On Mon, Apr 7, 2014 at 6:47 AM, checkmail

[firebird-support] Round - quarter hour

2014-04-07 Thread checkmail
Hello, in my Case I would round a integer number to a full quarter number: 12 to 15, 91 to 90, 98 to 105 etc. Is there anything I can use? Thanks a lot. Regards Olaf

Re: [firebird-support] Round - quarter hour

2014-04-07 Thread Thomas Beckmann
Hi Olaf, how abaout normalizing to quarters (divide by 15e0), rounding and multiply by 15? Thomas Am 08.04.2014 07:39, schrieb checkmail: Hello, in my Case I would round a integer number to a full quarter number: 12 to 15, 91 to 90, 98 to 105 etc. Is there anything I can

AW: [firebird-support] Round - quarter hour

2014-04-07 Thread checkmail
First example: timediff = mod(minutestoround,15); if(15/2 timediff) then roundedminutes = minutestoround + 15 - timediff; else roundedminutes = minutestoround - timediff; ? Von: firebird-support@yahoogroups.com

AW: [firebird-support] Round - quarter hour

2014-04-07 Thread checkmail
Hi, yes, every 15 Minutes. Von: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Im Auftrag von Thomas Beckmann Gesendet: Dienstag, 8. April 2014 07:47 An: firebird-support@yahoogroups.com Betreff: Re: [firebird-support] Round - quarter hour Hi Olaf, how