[firebird-support] stale statements in MON$STATEMENTS

2016-12-01 Thread Hamish Moffatt ham...@risingsoftware.com [firebird-support]
Hi,

I'm trying to debug a concurrency issue I'm having with an application 
of mine, connecting to Firebird 2.5.6, so I'm trying to understand the 
various monitor tables. I have dozens of threads all making their own 
connections to Firebird (superserver).

After running for a while my MON$STATEMENTS table shows over 100 
statements with in state 0 (idle) with no transaction ID. They are 
mostly "merge into ..." statements. I understand that the idle statement 
means they have been prepared but not executed, but this shouldn't be 
possible in my application source (prepare has never failed, and I 
always execute).

Is there something else I must be doing wrong to cause these to hang around?

I also have a couple of plain selects in that table.




thanks,


Hamish



Re: [firebird-support] Migration from Interbase 7.5 to Firebird 2.5.4

2016-12-01 Thread Jesus Garcia jeg...@gmail.com [firebird-support]

>> It is my First question in this group. 
>> 
>> I would like to know if someone has accomplished a migration from
>> 
>> Interbase 7.5 to Firebird 2.5.4 
I did it years ago.

1. Extract metadata from Interbase
2. Create the database in firebird with the metadata extracted. You may have to 
correct the source metadata, because the creation process will raise errors.
3. Once created firebird database, I used ibpump, free tool, to pump data from 
Interbase to firebird.
4. Test your application.

Jesús.

Re: [firebird-support] Migration from Interbase 7.5 to Firebird 2.5.4

2016-12-01 Thread Alexey Kovyazin a...@ib-aid.com [firebird-support]

Hi,

We did it several times for our clients.
Not very difficult, but requires to detect and rewrite wrong SQL queries.

Regards,
Alexey Kovyazin
IBSurgeon



Hi ,
It is my First question in this group.

I would like to know if someone has accomplished a migration from

Interbase 7.5 to Firebird 2.5.4




[firebird-support] Migration from Interbase 7.5 to Firebird 2.5.4

2016-12-01 Thread safirh...@yahoo.fr [firebird-support]
Hi ,
It is my First question in this group. I would like to know if someone has 
accomplished a migration from 
 Interbase 7.5 to Firebird 2.5.4 



RE: [firebird-support] Sequence

2016-12-01 Thread 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
Olag,


> Before
> Record 1 prio 3
> Record 2 prio 10
> Record 3 prio 18
> Record 4 prio 20
> Record 5 prio 30
> 
> The user set the record 4 to prio 15, I would like to do this:
> 
> Record 1 from 3 to 10
> Record 2 from 10 to 20
> Record 3 from 20 (should 15, Destination between record 2 and record 3)) to
> 30
> Record 4 to 40
> Record 5 to 50

You example is confusing.

If a user can never change the position of Record 4 ahead of Record 3 (as is 
the case in your example) what purpose does priority serve.

If you had said that the outcome you wanted was:

Record 1 from 3 to 10
Record 2 from 10 to 20
Record 4 to 30  <-*
Record 3 from 20 (should 15, Destination between record 2 and record 3)) to 40 
<-*
Record 5 to 50

Then that would have made sense.

Please clarify, the problem domain does matter to the solution.


Sean



[firebird-support] Sequence

2016-12-01 Thread 'Check_Mail' check_m...@satron.de [firebird-support]
Hello @ll,

 

in a table there a many records with prioritys 1, 4, ..

 

Now the user can set one record to 5 and after this, I would set all other
records before in steps of 10 and after this again:

 

For Example:

 

Before

Record 1 prio 3

Record 2 prio 10

Record 3 prio 18

Record 4 prio 20

Record 5 prio 30

 

The user set the record 4 to prio 15, I would like to do this:

 

Record 1 from 3 to 10

Record 2 from 10 to 20

Record 3 from 20 (should 15, Destination between record 2 and record 3)) to
30

Record 4 to 40

Record 5 to 50

 

How can I realize this without a loop? Update table set prio = .? Or with
cte?

 

Thank you.

 

Best regards.

 

Olaf



[firebird-support] Re: RES: VIEW CREATES ON FB 2.5 BUT DO NOT CREATE ON FB 1.5

2016-12-01 Thread Dmitry Yemanov dim...@users.sourceforge.net [firebird-support]
29.11.2016 13:45, 'Israel Pinheiro' wrote:
>
> Invalid Token. Dynamic SQL Error. Invalid Command Data Type unknown

Check datatypes of all union parts, i.e.

select A1, B1, C1
union
select A2, B2, C2
union
select A3, B3, C3

Data types for (A1, A2, A3) should match exactly. The same for B and C.


Dmitry




Re: [firebird-support] Basics of Statistics - Mathematics: Mean (Average), Median, Mode and Range ?

2016-12-01 Thread Svein Erling Tysvær setys...@gmail.com [firebird-support]
Don't know whether Firebird has internal functions for this or not and it
is likely that there are more elegant solutions available, but the below
queries should be ways to get what you ask (although I don't know whether
you want to return all values for mode and whether or not you want the
average in case of two median values).

execute block returns (mode integer) as
declare variable occurences integer;
declare variable dummy integer;
begin
  select , count(*)
  from 
  group by 1
  order by 2 desc
  rows 1
  into :dummy, :occurences;
  for select 
  from 
  group by 1
  having count(*) = :occurences
  into :mode do
suspend;
end

execute block returns (median decimal(9, 1)) as
declare variable occurences integer;
declare variable RowsFrom integer;
declare variable RowsTo   integer;
begin
  select count(*)
  from 
  into :occurences;
  RowsFrom = ((:occurences-1)/2)+1;
  RowsTo   = (:Occurences/2)+1;
  with tmp(tmp) as
  (select cast( as decimal(9, 1))
   from 
   rows :RowsFrom to :RowsTo)
  select sum(tmp)/(:RowsTo-:RowsFrom+1)
  from tmp
  into :Median;
  suspend;
end

select max()-min() as Range
from 

HTH,
Set

2016-12-01 4:41 GMT+01:00 Roberto Carlos rc.1...@bol.com.br
[firebird-support] :

> Basics of Statistics - Mathematics: Mean (Average), Median, Mode and Range
>
> I want to calculate Mean (Average), Median, Mode and Range in Firebird 2.5
> and 3.0.
>
> I know that Firebird internal function for Mean (Average) is AVG(), but
> what are the internal functions for Median, Mode and Range in Firebird 2.5
> and 3.0?
>
> If there are not such functions, how can I calculate them using Firebird?
>
> Thanks for all and any help.
>
>
> [Non-text portions of this message have been removed]
>
>
>
> 
> Posted by: Roberto Carlos 
> 
>
> ++
>
> 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
>
>
>
>