[firebird-support] Re: Firebird Embedded on web hosting

2015-09-22 Thread amigof...@gmail.com [firebird-support]
waow ! i have learned something today :) 

 i didn't know that envirenment options are associated to the process and not 
to the machine .
 

 anyway many many thanks it's solved now ... finally :)
 

 if anyone else have this problem maybe in the future, this is what  worked for 
me
 

 

 /*this will give absolute path on the server */

 string s = Path.GetDirectoryName(Server.MapPath("Default.aspx"));
 

 /* some logic only for me */
 s = s.Replace("v1", "Bin\\FIREBIRD_LOCK");
 

 Environment.SetEnvironmentVariable("FIREBIRD_LOCK", s);
 

/* after that you can make calls to the database or instanciate 
entity framework context  */

 



RE: [firebird-support] Slow Query

2015-09-22 Thread 'Leyne, Sean' s...@broadviewsoftware.com [firebird-support]
Stef,

> Can somebody please have a look at this query and let me know how I can
> improve the performance (10 seconds execute time)

You are processing the Journal table 3 times, for no real benefit AFAICT.

BTW, what fields are indexed, in what combinations?

To your question, how does this work for you?  (I would like to see the PLAN 
for this statement)


SELECT
  supplier, T.d120, T.d90,T.d60, T.d30, T.current_days, T.totaldue
FROM( 
SELECT
  s.suppid
  sum(iif(ddate <= '2015/05/31', debitamount - creditamount, 0)) as D120,
  sum(iif(ddate between '2015/06/01' and '2015/06/30', debitamount - 
creditamount, 0)) as D90,
  sum(iif(ddate between '2015/07/01' and '2015/07/31', debitamount - 
creditamount, 0)) as d60,
  sum(iif(ddate between '2015/08/01' and '2015/08/31', debitamount - 
creditamount, 0)) as d30,
  sum(iif(ddate between '2015/09/01' and '2015/09/30', debitamount - 
creditamount, 0)) as current_days,
  sum(debitamount - creditamount) as totaldue
from journal
where 
  accnr = 5995100
  and suppid = 3
  and ddate <= '2015/09/30'
  ) T
JOIN supplier s ON T.suppid = s.suppid
WHERE
T.TotalDue <>0 


Sean



RE: [firebird-support] Securing database against corruption on systems that suddenly get turned off

2015-09-22 Thread Glenn Thomas Hvidsten g...@vensafe.no [firebird-support]
Thanks for all the suggestions so far.
We have already put some of our clients computers on UPS. I'm still interested 
in other settings we can enable (or disable) to make the database server more 
robust without having to add a UPS.

Glenn Thomas Hvidsten

From: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com]
Sent: 21. september 2015 22:13
To: firebird-support@yahoogroups.com
Subject: RE: [firebird-support] Securing database against corruption on systems 
that suddenly get turned off



At 11:34 p.m. 21/09/2015, Glenn Thomas Hvidsten g...@vensafe.no 
[firebird-support] wrote:
>Thanks for the link.
>Without specifically setting a new value, how can I check what setting is 
>currently in use?

In Firebird's ..\bin directory, in a shell, do

gstat -h path\to\database
Look at the Attributes near the bottom. If "Force Write" is there, then it is 
on. If not, then it is off.

I echo the advice to put that server on a UPS. I consider I have problems if 
the power goes out once a month! which it does here, on average, due to the 
apparent inability of the council and telecoms workers to read a cable map 
before attacking the environment with digging machinery.

I have servers running all versions of Firebird on both Windows and Linux. I 
have an Eton 3S 700 UPS to which two desktop machines are connected; also my 
external backup drives and the shared monitor. I get more than enough time off 
this rather small UPS to shut everything down gracefully.

For the old versions and new betas I use a menagerie of old-but-good Thnkpad 
notebooks with good batteries. I run them off the mains and run them down on a 
monthly cycle to preserve the batteries. When the power goes out, I have 
several hours' coverage, more than I need. I also have one notebook acting as a 
replication target (see http://www.ibphoenix.com/products/software/ibreplicator 
), which gives me a "hot backup" in case the source database[s] get corrupted 
by a power cut. To date, I haven't had any corrupted databases of my own.

I have one TP T43 running Linux that is a brilliant machine but the power jack 
is broken so I have to run it off a port replicator attached to the mains. I 
also have an old T42 whose cooling system is dead. So I use the T42 to charge 
the batteries for the T43 so that she always has a charged battery on board. 
The total cost of both of those machines, bought as "refurbs", was less than 
$100.

I feel it is bad enough that your customer doesn't care enough about his data 
to have the best UPS money can buy. But doesn't he care about hardware damage, 
either?

Helen Borrie, Support Consultant, IBPhoenix (Pacific)
Author of "The Firebird Book" and "The Firebird Book Second Edition"
http://www.firebird-books.net
__




  Denne epost har blitt kontrollert for virus av Comendo Norge AS
This e-mail has been scanned for viruses by http://www.comendo.no



[Non-text portions of this message have been removed]



[firebird-support] Slow Query

2015-09-22 Thread 'Stef' s...@autotech.co.za [firebird-support]
Hi All

 

Can somebody please have a look at this query and let me know how I can
improve the performance (10 seconds execute time)

 

with DateSource(suppid, ddate, source2) as  

(select distinct suppid, ddate, source2   

 from journal   

 where accnr = 5995100

 and suppid = 3

 ), 

 tmp(suppid, source, ddate, paid, invoicetotal) as 

 (select  d.suppid, d.source2, d.ddate, sum(debitamount),
sum(creditamount)   

 from journal j 

 join DateSource d on j.ddate = d.ddate and j.source2 = d.source2
and j.suppid = d.suppid

 where j.accnr = 5995100

 and d.suppid = 3

 group by 1,2 ,3),




tmp2(account_nr, supplier, d120, d90,d60,d30,current_days, Totaldue) as


  (select distinct s.suppid, trim(s.supplier),

   sum(iif(ddate <= '2015/05/31', invoicetotal - paid, 0)) as D120,


   sum(iif(ddate between '2015/06/01' and '2015/06/30', invoicetotal -
paid, 0)) as D90, 

   sum(iif(ddate between '2015/07/01' and '2015/07/31', invoicetotal -
paid, 0)) as d60 ,

   sum(iif(ddate between '2015/08/01' and '2015/08/31', invoicetotal -
paid, 0)) as d30 ,

   sum(iif(ddate between '2015/09/01' and '2015/09/30', invoicetotal -
paid, 0)) as current_days ,   

   sum(iif(ddate <= '2015/09/30', invoicetotal - paid, 0)) as totaldue


 


from tmp t


join supplier s on t.suppid = s.suppid


group by 1,2


having sum(iif(ddate <= '2015/09/30', invoicetotal - paid, 0)) <> 0)


select account_nr, supplier, d120, d90,d60,d30,current_days, totaldue


 from tmp2


order by 2,1

 

 

Regards

 

Stef van der Merwe



[Non-text portions of this message have been removed]



Re: [firebird-support] Securing database against corruption on systems that suddenly get turned off

2015-09-22 Thread Lester Caine les...@lsces.co.uk [firebird-support]
On 22/09/15 10:31, Glenn Thomas Hvidsten g...@vensafe.no
[firebird-support] wrote:
> Thanks for all the suggestions so far.
> We have already put some of our clients computers on UPS. I'm still 
> interested in other settings we can enable (or disable) to make the database 
> server more robust without having to add a UPS.

This brings back a few memories from 20 years ago. Has a site that kept
loosing the whole days data after working perfectly during the day, and
printing off the reports. This was back in Interbase days ;) It took a
couple of weeks and a bit of luck to spot the cleaner pulling the plug
marked 'do not remove' so she could plug in her vacuum! She just reached
around the corner without even looking and pulled the first plug she
felt. Pigging annoying, and a hard wired supply was arranged, but why
did ALL the data go you should be asking? Windows was caching the writes
to disk and did not ACTUALLY write anything until the program was
closed! EVEN with 'forced writes' switched on. Forget which version of
windows now but probably W3.1. We added some extra code and started
closing the program after a report run and things were then stable
enough that one could pull the plug during the day and restart without
only an occasional corruption.

We moved most sites onto XP early on in it's life, and that just ran and
ran even with the occasional power loss. Would I trust modern windows to
be as reliable ... NO ... since moving to W7 sites all have at least one
problem a month even with UPS's! I've had to repair a database more than
once and have lost data so I think at least on Windows one is stuck with
the risk ...

-- 
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk






++

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

<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/firebird-support/

<*> Your email settings:
Individual Email | Traditional

<*> To change settings online go to:
http://groups.yahoo.com/group/firebird-support/join
(Yahoo! ID required)

<*> To change settings via email:
firebird-support-dig...@yahoogroups.com 
firebird-support-fullfeatu...@yahoogroups.com

<*> To unsubscribe from this group, send an email to:
firebird-support-unsubscr...@yahoogroups.com

<*> Your use of Yahoo Groups is subject to:
https://info.yahoo.com/legal/us/yahoo/utos/terms/



RE: [firebird-support] Support for OS X 10.11 El Capitan

2015-09-22 Thread 'Paul Beach' pabe...@waitrose.com [firebird-support]

>

I am currently using 10.10.5 not 10.11 and I will not be upgrading to
10.11 yet as its only in late RC, but the release date is September 30, 2015
So when it goes GM I guess I get to install it and try and work out whats wrong,
and come up with a solution.

In terms of Firebird 3.0, Firebird compiles on MacOSX, but I have been waiting 
for
RC1 so all the 64bit txn id code is committed. When RC1 is tagged I will start
work on the MacOSX port and installer.


Currently this is how I install it:
Right Click on the pkg file, and choose open, then select open again
But I guess that mechanism won't work mow because of SIP, I did find this:

The supported way to disable System Integrity Protection in those cases where 
it’s truly
necessary is to boot into the Recovery partition and turn System Integrity 
Protection off
from there with the csrutil tool.

$ csrutil
usage: csrutil
Modify the System Integrity Protection configuration. All configuration changes 
apply to the entire machine.
Available commands:
disable
Disable the protection on the machine. Requires a reboot.
enable
Enable the protection on the machine. Requires a reboot.
status
Display the current configuration.

The kext-dev-mode and rootless boot-args are being removed from OS X El Capitan 
and will no longer work.

But reading further the sort of places that are protected are /System, /bin, 
/sbin and /usr
whilst we install into /Applications/Frameworks... So is there anything when 
you try to install it, where it
confirms that this is a SIP problem?

Paul



RE: [firebird-support] How to Extract Filename from file path inside a stored procedure?

2015-09-22 Thread 'stwizard' stwiz...@att.net [firebird-support]
Mark,

 

Thank you and the other gentleman that replied as I was able to create my own 
SP to do exactly what I needed to do and it works in both version of Firebird.

 

Mike