[firebird-support] Firebird can't connect to host

2014-11-14 Thread Andromeda andromedar...@gmail.com [firebird-support]
Hello,


I'm new in FirebirdSQL. I can't connect into my host address whereas it can
connect to localhost successfully. It prompt show errors like this:


SQL> connect "192.168.1.37:/var/lib/firebird/2.5/data/employee.fdb"
user 'SYSDBA' password 'masterkey';
Statement failed, SQLSTATE = 08006
Unable to complete network request to host "192.168.1.50".
-Failed to establish a connection.


I have Googled about this for almost a month but I can't find the absolute
way to solve this problem. My ufw firewall already deactivated, the port
3050 is opened, but it still can't connect into my host address, but easily
connect to the 127.0.0.1. The Firebird classic server is running on Lubuntu
Desktop 14.04.1 and the version of Firebird is 2.5.


This problem occured since I reinstall/upgrading my OS from 13.xxx into
14.xxx Lubuntu version. On the previous OS, I never facing an error like
this.


What's going wrong here?
Whether this problem related to OS version, or just a dumb error that I
can't solve, I don't know and I very need an help from the experts, please.


Any help would be very appreciated, thank a lot in advance.


Regards,
Andromeda


RE: [firebird-support] sum data into single row per day

2014-11-14 Thread Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]
>   for select
> iif(n.code=1,sum(n.amount),0),
> iif(n.code=2,sum(n.amount),0),
> iif(n.code=3,sum(n.amount),0),
> n.sell_date
>   from  new_table n
>   where n.sell_date between :fromdate and :uptodate
>   group by n.sell_date,n.code
>   into
> :stock,
> :repair,
> :sh,
> :sell_date
>
>This gives the correct totals but not in the correct format:
>
>SELL_DATE  STOCK   REPAIR  SH
>07.11.2014 0   0   30
>10.11.2014 160 0   0
>10.11.2014 0   20  0
>11.11.2014 100 0   0
>11.11.2014 0   22000
>11.11.2014 0   0   500
>
>What I want is this format, one row per day:
>
>SELL_DATE  STOCK   REPAIR  SH
>07.11.2014 0   0   30
>10.11.2014 160 20  0
>11.11.2014 100 2200500

You almost got it right, Alan, just remember to only group only on things you 
want to produce a separate row. This is the query you want:

select sell_date,
   sum(iif(code=1, amount,0)) stock,
   sum(iif(code=2, amount,0)) repair,
   sum(iif(code=3, amount,0)) SH,
from  new_table
where n.sell_date between :fromdate and :uptodate
group by sell_date

Set


Re: [firebird-support] Change Write Mode

2014-11-14 Thread Tiziano tmdevelo...@yahoo.com [firebird-support]
I have different software connected to db:
1. Delphi + IB_Object/IBO2. Web/WCF + NHibernate + Firebird ADO.NET3. Winforms 
+ Firebird ADO.NET 4. DB Access (linked to firebird with external table) + ODBC
It is possible that a data connection change write mode?


 Il Giovedì 13 Novembre 2014 17:48, "Thomas Steinmaurer 
t...@iblogmanager.com [firebird-support]"  ha 
scritto:
   

 > *UPDATE*
> I have changed batch, switch -online before change write mode.
> Actually the batch is:
> "%FB_PATH%\GSTAT.EXE" -h %DB1% >> %LOG_FILE%
> "%FB_PATH%\GFIX.EXE" -shut full -force 0 -user SYSDBA -password
> masterkey %DB1% >> %LOG_FILE%
> "%FB_PATH%\GFIX.EXE" -online normal -user SYSDBA -password masterkey
> %DB1% >> %LOG_FILE%
> "%FB_PATH%\GFIX.EXE" -write sync -user SYSDBA -password masterkey %DB1%
>  >> %LOG_FILE%
> "%FB_PATH%\GSTAT.EXE" -h %DB1% >> %LOG_FILE%
>
>  From log file it's all ok:
>
>  2014_11_13  3.30.50,84
> [...]
>      Next header page    0
>      Database dialect    3
>      Creation date        Aug 19, 2014 21:56:08
>      Attributes
>
>      Variable header data:
>      Sweep interval:        2
>      *END*
>
> 
> [...]
>      Page buffers        0
>      Next header page    0
>      Database dialect    3
>      Creation date        Aug 19, 2014 21:56:08
>      Attributes force write
>
>      Variable header data:
>      Sweep interval:    2
>      *END*
>
>
> But actually force write is off:
>
>  2014_11_13 10.45.33,75
> [...]
>      Implementation ID    16
>      Shadow count        0
>      Page buffers        0
>      Next header page    0
>      Database dialect    3
>      Creation date        Aug 19, 2014 21:56:08
>      Attributes <<
>
>      Variable header data:
>      Sweep interval:        2
>      *END*
>
>
> How is possible? Any idea? Firebird versione is 2.5.3 on Windows
> Standard Server 2008.

What data access technology are you using?



-- 
With regards,
Thomas Steinmaurer
http://www.upscene.com/

Professional Tools and Services for Firebird
FB TraceManager, IB LogManager, Database Health Check, Tuning etc.






++

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] Change Write Mode

2014-11-14 Thread 'Thomas Steinmaurer' t...@iblogmanager.com [firebird-support]
> I have different software connected to db:
> 1. Delphi + IB_Object/IBO2. Web/WCF + NHibernate + Firebird ADO.NET3. Winforms
> + Firebird ADO.NET 4. DB Access (linked to firebird with external table) + 
> ODBC
> It is possible that a data connection change write mode?

Yes. In your IBO application, what is the value of TIB_connection.ForcedWrites? 
I vaguely remember a bug there in the connection design editor flipping the 
property explicitely to False although "Default" is the default and recommended 
value for that.

--
With regards,
Thomas Steinmaurer
http://www.upscene.com

Professional Tools and Services for Firebird
FB TraceManager, IB LogManager, Database Health Check, Tuning etc.


> Il Giovedì 13 Novembre 2014 17:48, "Thomas Steinmaurer 
> t...@iblogmanager.com
> [firebird-support]"  ha scritto:
>   
> 
> > *UPDATE*
>> I have changed batch, switch -online before change write mode.
>> Actually the batch is:
>> "%FB_PATH%\GSTAT.EXE" -h %DB1% >> %LOG_FILE%
>> "%FB_PATH%\GFIX.EXE" -shut full -force 0 -user SYSDBA -password
>> masterkey %DB1% >> %LOG_FILE%
>> "%FB_PATH%\GFIX.EXE" -online normal -user SYSDBA -password masterkey
>> %DB1% >> %LOG_FILE%
>> "%FB_PATH%\GFIX.EXE" -write sync -user SYSDBA -password masterkey %DB1%
>>  >> %LOG_FILE%
>> "%FB_PATH%\GSTAT.EXE" -h %DB1% >> %LOG_FILE%
>>
>>  From log file it's all ok:
>>
>>  2014_11_13  3.30.50,84
>> [...]
>>      Next header page    0
>>      Database dialect    3
>>      Creation date        Aug 19, 2014 21:56:08
>>      Attributes
>>
>>      Variable header data:
>>      Sweep interval:        2
>>      *END*
>>
>> 
>> [...]
>>      Page buffers        0
>>      Next header page    0
>>      Database dialect    3
>>      Creation date        Aug 19, 2014 21:56:08
>>      Attributes force write
>>
>>      Variable header data:
>>      Sweep interval:    2
>>      *END*
>>
>>
>> But actually force write is off:
>>
>>  2014_11_13 10.45.33,75
>> [...]
>>      Implementation ID    16
>>      Shadow count        0
>>      Page buffers        0
>>      Next header page    0
>>      Database dialect    3
>>      Creation date        Aug 19, 2014 21:56:08
>>      Attributes <<
>>
>>      Variable header data:
>>      Sweep interval:        2
>>      *END*
>>
>>
>> How is possible? Any idea? Firebird versione is 2.5.3 on Windows
>> Standard Server 2008.
> 
> What data access technology are you using?
> 
> 
> 
> -- 
> With regards,
> Thomas Steinmaurer
> http://www.upscene.com/
> 
> Professional Tools and Services for Firebird
> FB TraceManager, IB LogManager, Database Health Check, Tuning etc.
> 
> 
> 
> 
> 
> 
> ++
> 
> 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
> 
> 
> 
> 
> 
>   



[firebird-support] Re: Why does the optimizer choose NATURAL for this tiny table?

2014-11-14 Thread Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support]
>> D1) ON p.icd10 = t.icd10
>>
>> These change the plan to:
>> PLAN JOIN (MERGE (SORT (JOIN (P NATURAL, G INDEX 
>> (I_ICD10_GRUPPE_ICD10))), SORT (JOIN (T KID INDEX (U_NPR_KRG_ID_FNRK), 
>> T N INDEX (I_NPR_KRG_ID), T T INDEX (I_NPR_TILSTAND_ID_NPR, I 
>> INDEX (PK_ICD10))
>
>Interesting. The only possible explanation is that the datatypes for
>P.ICD10 and T.ICD10 differ. ICD10 is an expression inside T, so its hard to 
>say what the resulting data type is.

Oh, now you're surprising me, Dmitry! I thought it simply was the optimizer 
considering the two different plans to be approximately equally useful and that 
it chose one of them if comparing against one value, but the other when 
comparing against two (or more) values.

Both fields are ISO8859_1 (which is also the default character set of the 
database) with NO_NO as collation. It wouldn't surprise me if the collation got 
lost when doing IIF(COALESCE, ...), but I'm surprised if the character set 
changes to something that's neither the character set of the originating column 
nor the default character set of the database.

Thanks for suggestions from both of you, Dmitry & Sean! I was just looking for 
a simple answer that could increase my understanding, but take it now that the 
answer isn't all that simple. No need to look further into this now, after all, 
I haven't even finished my program that will run the procedure 50 times and 
don't even know how quick or slow it will be yet.

Thanks,
Set


Re: [firebird-support] Change Write Mode

2014-11-14 Thread Tiziano tmdevelo...@yahoo.com [firebird-support]
I have found a lot of TIB_Connection and TIBODatabase with ForcedWrites = 
dpbFalse (now changed to "dpbDefault").Thanks so much for the help!! 

 Il Venerdì 14 Novembre 2014 10:18, "'Thomas Steinmaurer' 
t...@iblogmanager.com [firebird-support]"  ha 
scritto:
   

     > I have different software connected to db:
> 1. Delphi + IB_Object/IBO2. Web/WCF + NHibernate + Firebird ADO.NET3. Winforms
> + Firebird ADO.NET 4. DB Access (linked to firebird with external table) + 
> ODBC
> It is possible that a data connection change write mode?

Yes. In your IBO application, what is the value of TIB_connection.ForcedWrites? 
I vaguely remember a bug there in the connection design editor flipping the 
property explicitely to False although "Default" is the default and recommended 
value for that.

--
With regards,
Thomas Steinmaurer
http://www.upscene.com

Professional Tools and Services for Firebird
FB TraceManager, IB LogManager, Database Health Check, Tuning etc.

> Il Giovedì 13 Novembre 2014 17:48, "Thomas Steinmaurer t...@iblogmanager.com
> [firebird-support]"  ha scritto:
> 
> 
> > *UPDATE*
>> I have changed batch, switch -online before change write mode.
>> Actually the batch is:
>> "%FB_PATH%\GSTAT.EXE" -h %DB1% >> %LOG_FILE%
>> "%FB_PATH%\GFIX.EXE" -shut full -force 0 -user SYSDBA -password
>> masterkey %DB1% >> %LOG_FILE%
>> "%FB_PATH%\GFIX.EXE" -online normal -user SYSDBA -password masterkey
>> %DB1% >> %LOG_FILE%
>> "%FB_PATH%\GFIX.EXE" -write sync -user SYSDBA -password masterkey %DB1%
>>  >> %LOG_FILE%
>> "%FB_PATH%\GSTAT.EXE" -h %DB1% >> %LOG_FILE%
>>
>>  From log file it's all ok:
>>
>>  2014_11_13  3.30.50,84
>> [...]
>>      Next header page    0
>>      Database dialect    3
>>      Creation date        Aug 19, 2014 21:56:08
>>      Attributes
>>
>>      Variable header data:
>>      Sweep interval:        2
>>      *END*
>>
>> 
>> [...]
>>      Page buffers        0
>>      Next header page    0
>>      Database dialect    3
>>      Creation date        Aug 19, 2014 21:56:08
>>      Attributes force write
>>
>>      Variable header data:
>>      Sweep interval:    2
>>      *END*
>>
>>
>> But actually force write is off:
>>
>>  2014_11_13 10.45.33,75
>> [...]
>>      Implementation ID    16
>>      Shadow count        0
>>      Page buffers        0
>>      Next header page    0
>>      Database dialect    3
>>      Creation date        Aug 19, 2014 21:56:08
>>      Attributes <<
>>
>>      Variable header data:
>>      Sweep interval:        2
>>      *END*
>>
>>
>> How is possible? Any idea? Firebird versione is 2.5.3 on Windows
>> Standard Server 2008.
> 
> What data access technology are you using?
> 
> 
> 
> -- 
> With regards,
> Thomas Steinmaurer
> http://www.upscene.com/
> 
> Professional Tools and Services for Firebird
> FB TraceManager, IB LogManager, Database Health Check, Tuning etc.
> 
> 
> 
> 
> 
> 
> ++
> 
> 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
> 
> 
> 
> 
> 
> 

  #yiv5091572647 #yiv5091572647 -- #yiv5091572647ygrp-mkp {border:1px solid 
#d8d8d8;font-family:Arial;margin:10px 0;padding:0 10px;}#yiv5091572647 
#yiv5091572647ygrp-mkp hr {border:1px solid #d8d8d8;}#yiv5091572647 
#yiv5091572647ygrp-mkp #yiv5091572647hd 
{color:#628c2a;font-size:85%;font-weight:700;line-height:122%;margin:10px 
0;}#yiv5091572647 #yiv5091572647ygrp-mkp #yiv5091572647ads 
{margin-bottom:10px;}#yiv5091572647 #yiv5091572647ygrp-mkp .yiv5091572647ad 
{padding:0 0;}#yiv5091572647 #yiv5091572647ygrp-mkp .yiv5091572647ad p 
{margin:0;}#yiv5091572647 #yiv5091572647ygrp-mkp .yiv5091572647ad a 
{color:#ff;text-decoration:none;}#yiv5091572647 #yiv5091572647ygrp-sponsor 
#yiv5091572647ygrp-lc {font-family:Arial;}#yiv5091572647 
#yiv5091572647ygrp-sponsor #yiv5091572647ygrp-lc #yiv5091572647hd {margin:10px 
0px;font-weight:700;font-size:78%;line-height:122%;}#yiv5091572647 
#yiv5091572647ygrp-sponsor #yiv5091572647ygrp-lc .yiv5091572647ad 
{margin-bottom:10px;padding:0 0;}#yiv5091572647 #yiv5091572647actions 
{font-family:Verdana;font-size:11px;padding:10px 0;}#yiv5091572647 
#yiv5091572647activity 
{background-color:#e0ecee;float:left;font-family:Verdana;font-size:10px;padding:10px;}#yiv5091572647
 #yiv5091572647activity span {font-weight:700;}#yiv5091572647 
#yiv5091572647activity span:first-child 
{text-transform:uppercase;}#yiv5091572647 #yiv5091572647activity span a 
{color:#5085b6;text-decoration:none;}#yiv5091572647 #yiv5091572647activity span 
span {color:#ff7900;}#yiv5091572647 #yiv5091572647ac

[firebird-support] Cross database update

2014-11-14 Thread masb...@za-management.com [firebird-support]
Hi All!
I am having problems regarding an update skript I want to write that fetsches 
data from table1 in db1 and writes the result into exisiting records in table2 
in db2.
To mange this task I am using firebird 2.1.5 and a tool called IBExpert with a 
script extension called ibeblock, that lets me specify different db connections 
within this script.

Like this I a have created a second db with analysis data that holds aggregated 
amounts for all cases and other analytical data. This is queried in db1 and 
then written to db2, where the relevant tables have been cleared prior the 
insert. This process runs every night and takes about an hour to run through.

I now want to write some parts of the data back to db1 to have some evaluation 
data available here.

I have read that firebird 2.5 offers an additional "on external" function in an 
execute statement but this is still 2.1.

Furthermore I have the problem that there are several triggers present in db1 
which have to be activated or passed by. I found an article regarding 
rdb$get_context and rdb$get_context and therefore I prepared the triggers. 

So my script looks like this, but has no effect at all.
It worked fine testwise with just one record update. 
There has to be some problem in the loop, but I don't know why:

execute ibeblock
as
begin

--This time the Analysis DB is the source
   FBSRC  = ibec_CreateConnection(__ctFirebird,'DBName="PATH to DB1";
   ClientLib=C:\WINDOWS\system32\fbclient.dll;
   user=XX; password=XX; names=ISO8859_1; sqldialect=3');

-- and writes to the Test DB/Prod. DB
   FBDEST  = ibec_CreateConnection(__ctFirebird,'DBName="PATH to DB2";
   ClientLib=C:\WINDOWS\system32\fbclient.dll;
   user=XX; password=XX; names=ISO8859_1; sqldialect=3');

   ibec_UseConnection(FBSRC);
   ibec_UseConnection(FBDEST);

use FBSRC;
for select
(lrc.paid_claims_eur + lrc.paid_costs_eur - lrc.paid_recoveries_eur + 
lrc.paid_fees_eur +
lrc.os_claims_eur + lrc.os_costs_eur - lrc.os_recoveries_eur) as TCACCY,
(lrc.paid_claims_usd + lrc.paid_costs_usd - lrc.paid_recoveries_usd + 
lrc.paid_fees_usd +
lrc.os_claims_usd + lrc.os_costs_usd - lrc.os_recoveries_usd) as 
TCACCY2,
current_date, lrc.file_id
from loss_record_claims lrc
where lrc.file_id in (120966,120214) --testwise just two records
into
:TCACCY, :TCACCY2, :DATEFILTER, :FILE_ID
do
  begin

use FBDEST;
  TRY
execute statement 'execute block as begin 
rdb$set_context(''USER_TRANSACTION'', ''bulkload'', ''1'');
update files f set f.ccy_total_claim_amount_net = :TCACCY, 
f.ccy2_total_claim_amount_net = :TCACCY2, f.date_filter = :DATEFILTER
where f.file_id = :FILE_ID;end';
  EXCEPT
  END
end
commit;
   ibec_CloseConnection(FBSRC);
   ibec_CloseConnection(FBDEST);
end


I hope someone can help my. Transactionwise I got the info from the developer 
of IBExpert that by default, the script editor creates one transaction per 
connection. But I made tests without the trigger deactivation and created a 
trigger log and found out that there was one transaction per cycle of the loop.
I think that this is wrong, but I am not sure.

Kind regards
Christian

[firebird-support] Backup/Restore Required ???

2014-11-14 Thread t...@camalot.ca [firebird-support]
Wondering if a Backup/Restore is requird for moving from 2.5.2 to 2.5.3?

I have done it here without any issues so far, but thought I better ask the 
question.

Todd Brasseur
Compass Municipal Services Inc.

[firebird-support] Re: Backup/Restore Required ???

2014-11-14 Thread t...@camalot.ca [firebird-support]
Thanks a bunch.

Todd

Re: [firebird-support] Backup/Restore Required ???

2014-11-14 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 14 Nov 2014 08:08:59 -0800, "t...@camalot.ca [firebird-support]"
 wrote:
> Wondering if a Backup/Restore is requird for moving from 2.5.2 to 2.5.3?
> 
> I have done it here without any issues so far, but thought I better ask
> the question.

It isn't technically necessary when moving from 2.5.2 to 2.5.3, but it is
necessary when moving from 2.5.1 (!). The release notes say this:
http://www.firebirdsql.org/file/documentation/release_notes/html/rlsnotes253.html#notes-253

Between 'major' versions of Firebird (eg 2.0 to 2.1 to 2.5) it is not
required to backup/restore, but you need to do it to upgrade the database
to access some of the new features. To Firebird 3 you will always need to
do a backup and restore because older database structure versions are not
supported.

Mark


Re: [firebird-support] Backup/Restore Required ???

2014-11-14 Thread Thomas Steinmaurer t...@iblogmanager.com [firebird-support]
> Wondering if a Backup/Restore is requird for moving from 2.5.2 to 2.5.3?

Usually this is not needed when the ODS version hasn't been changed 
(between maintenance releases), but there is a special situation when 
coming from 2.5.1:
http://www.firebirdsql.org/file/documentation/release_notes/html/rlsnotes253.html#notes-253

So, if your database was previously created with 2.5.2 or 2.5.0 then you 
are fine. If the database has been created with 2.5.1 then consider the 
warning in the link above.


-- 
With regards,
Thomas Steinmaurer
http://www.upscene.com/

Professional Tools and Services for Firebird
FB TraceManager, IB LogManager, Database Health Check, Tuning etc.



> I have done it here without any issues so far, but thought I better ask
> the question.
>
> Todd Brasseur
> Compass Municipal Services Inc.
>
> 




Re: [firebird-support] Cross database update

2014-11-14 Thread Thomas Steinmaurer t...@iblogmanager.com [firebird-support]
Hello Christian,

> I am having problems regarding an update skript I want to write that
> fetsches data from table1 in db1 and writes the result into exisiting
> records in table2 in db2.
> To mange this task I am using firebird 2.1.5 and a tool called IBExpert
> with a script extension called ibeblock, that lets me specify different
> db connections within this script.
>
> Like this I a have created a second db with analysis data that holds
> aggregated amounts for all cases and other analytical data. This is
> queried in db1 and then written to db2, where the relevant tables have
> been cleared prior the insert. This process runs every night and takes
> about an hour to run through.
>
> I now want to write some parts of the data back to db1 to have some
> evaluation data available here.
>
> I have read that firebird 2.5 offers an additional "on external"
> function in an execute statement but this is still 2.1.
>
> Furthermore I have the problem that there are several triggers present
> in db1 which have to be activated or passed by. I found an article
> regarding rdb$get_context and rdb$get_context and therefore I prepared
> the triggers.
>
> So my script looks like this, but has no effect at all.
> It worked fine testwise with just one record update.
> There has to be some problem in the loop, but I don't know why:
>
> execute ibeblock
> as
> begin
>
> --This time the Analysis DB is the source
> FBSRC  = ibec_CreateConnection(__ctFirebird,'DBName="PATH to DB1";
> ClientLib=C:\WINDOWS\system32\fbclient.dll;
> user=XX; password=XX; names=ISO8859_1; sqldialect=3');
>
> -- and writes to the Test DB/Prod. DB
> FBDEST  = ibec_CreateConnection(__ctFirebird,'DBName="PATH to DB2";
> ClientLib=C:\WINDOWS\system32\fbclient.dll;
> user=XX; password=XX; names=ISO8859_1; sqldialect=3');
>
> ibec_UseConnection(FBSRC);
> ibec_UseConnection(FBDEST);
>
> use FBSRC;
> for select
>  (lrc.paid_claims_eur + lrc.paid_costs_eur -
> lrc.paid_recoveries_eur + lrc.paid_fees_eur +
>  lrc.os_claims_eur + lrc.os_costs_eur - lrc.os_recoveries_eur)
> as TCACCY,
>  (lrc.paid_claims_usd + lrc.paid_costs_usd -
> lrc.paid_recoveries_usd + lrc.paid_fees_usd +
>  lrc.os_claims_usd + lrc.os_costs_usd - lrc.os_recoveries_usd)
> as TCACCY2,
>  current_date, lrc.file_id
>  from loss_record_claims lrc
>  where lrc.file_id in (120966,120214) --testwise just two records
> into
>  :TCACCY, :TCACCY2, :DATEFILTER, :FILE_ID
> do
>begin
>
> use FBDEST;
>TRY
>  execute statement 'execute block as begin
> rdb$set_context(''USER_TRANSACTION'', ''bulkload'', ''1'');
>  update files f set f.ccy_total_claim_amount_net = :TCACCY,
> f.ccy2_total_claim_amount_net = :TCACCY2, f.date_filter = :DATEFILTER
>  where f.file_id = :FILE_ID;end';
>EXCEPT
>END
>  end
> commit;
> ibec_CloseConnection(FBSRC);
> ibec_CloseConnection(FBDEST);
> end
>
>
> I hope someone can help my. Transactionwise I got the info from the
> developer of IBExpert that by default, the script editor creates one
> transaction per connection. But I made tests without the trigger
> deactivation and created a trigger log and found out that there was one
> transaction per cycle of the loop.
> I think that this is wrong, but I am not sure.

This all is proprietary IBExpert stuff, thus I'm afraid the best support 
you can get is by contacting HK-Software (again).

Perhaps behind the scene is some sort of transaction magic, thus you 
might widen the context of the RDB$SET_CONTEXT call by using 
USER_SESSION instead of USER_TRANSACTION.

Another approach to dismiss triggers for such kind of bulk operations, 
similar to the "context" approach is to connect with a different user 
and check/handle the user name information inside the trigger.



-- 
With regards,
Thomas Steinmaurer
http://www.upscene.com/

Professional Tools and Services for Firebird
FB TraceManager, IB LogManager, Database Health Check, Tuning etc.


Re: [firebird-support] sum data into single row per day

2014-11-14 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Thank you Svein, that's what I tried but kept getting:
SQL error code = -104.
Invalid expression in the select list (not contained in either an 
aggregate function or the GROUP BY clause).

and yet it now works. I thought it must have been because I was 
accessing code in the iif(...). I must have had a typo that I could not 
see for looking. Anyway, that now works perfectly, without the ',' after SH.
Regards
Alan

Alan J Davies
Aldis


On 14/11/2014 08:41, Svein Erling Tysvær 
svein.erling.tysv...@kreftregisteret.no [firebird-support] wrote:
> select sell_date,
> sum(iif(code=1, amount,0)) stock,
> sum(iif(code=2, amount,0)) repair,
> sum(iif(code=3, amount,0)) SH,
> from new_table
> where n.sell_date between :fromdate and :uptodate
> group by sell_date


[firebird-support] Firebird on Mac

2014-11-14 Thread 'William, David' david.will...@espn.com [firebird-support]
Hi,


I am trying to run Firebird on mac (our standard development platform). I have 
tried all server packages available on Firebirdsql.org .


The installation process runs ok.
But whenever I try to start the server, I get this:


$ fbguard
fbguard: Invalid user (must be firebird, interbase, interbas or root).


If I try to start the server with the root password, nothing happens. No output 
at all and no server running.


A little bit about my scenario:


We have some desktop apps running on Windows and we would like to translate it 
to web app, keeping the same Firebird databases. We will use Ruby on Rails.


We use Macs and we need to setup a local Firebird machine.


My current Firebird installation have the following binaries:


  16 -rwxr-xr-x   1 firebird  firebird5259 Jul  9 09:26 
changeMultiConnectMode.sh
  24 -rwsr-sr-x   1 firebird  firebird8576 Jul  9 09:26 fb_inet_server
1264 -rwxr-xr-x   1 firebird  firebird  643936 Jul  9 09:26 fb_lock_print
1624 -rwxr-xr-x   1 firebird  firebird  830060 Jul  9 09:26 fb_smp_server
 496 -rwxr-xr-x   1 firebird  firebird  253648 Jul  9 09:26 fbguard
 504 -rwxr-xr-x   1 firebird  firebird  254928 Jul  9 09:26 fbsvcmgr
 520 -rwxr-xr-x   1 firebird  firebird  264792 Jul  9 09:26 fbtracemgr
1080 -rwxr-xr-x   1 firebird  firebird  552144 Jul  9 09:26 gbak
1224 -rwxr-xr-x   1 firebird  firebird  623808 Jul  9 09:26 gdef
 656 -rwxr-xr-x   1 firebird  firebird  335844 Jul  9 09:26 gfix
1296 -rwxr-xr-x   1 firebird  firebird  663112 Jul  9 09:26 gpre
1192 -rwxr-xr-x   1 firebird  firebird  610228 Jul  9 09:26 gsec

1144 -rwxr-xr-x   1 firebird  firebird  581820 Jul  9 09:26 gstat
1488 -rwxr-xr-x   1 firebird  firebird  759696 Jul  9 09:26 isql
1152 -rwxr-xr-x   1 firebird  firebird  586068 Jul  9 09:26 nbackup
1152 -rwxr-xr-x   1 firebird  firebird  588604 Jul  9 09:26 qli


Thanks.
David William