[firebird-support] RE: Stored Proc optimisation advice

2012-09-12 Thread Maya Opperman
>>I have a stored proc that calculates account balances. Most of the time it >>takes between 1-2 seconds, but every now and then it takes 22 seconds. >>It seems to be approx. every 5 or 6 records. >>Ie. I have a stores procedure that returns a list of 6 accounts and their >>balances. >>I have

[firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread Mr. John
Hi,I'm using FB 2.5.1.26351 SS  on  XP SP3,I have one stored procedure,also inside  FOR EXECUTE STATEMENT loop I have this query  SELECT FIRST 1 id_cf,numar FROM CB_FC WHERE  ID_CF=:wid_cf AND numar=:wNUMAR INTO :xid_cf,:xnumar;     wNUMAR,wid_cf  are also variables   declare xID_CF bigint;DEC

Re: [firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread masotti
Hi, On 12/09/2012 12:18, Mr. John wrote: > What I don't understand,for this query > ... >SELECT FIRST 1 id_cf,numar FROM CB_FC WHERE ID_CF=:wid_cf AND > numar=:wNUMAR INTO :xid_cf,:xnumar; >IF (wNUMAR=10739 and wid_cf=202) THEN >begin >

Re: [firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread Mr. John
Hi masotti ,thanks for your answer,I always thought in this case when select doesn't return a record,these variables are set to NULL,that I was wrong ? thanks From: masotti To: firebird-support@yahoogroups.com Sent: Wednesday, September 12, 2012 2:03 PM Subje

Re: [firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread Lucas Franzen
Am 12.09.2012 13:13, schrieb Mr. John: > Hi masotti ,thanks for your answer,I always thought in this case when > select doesn't return a record,these variables are set to NULL,that I > was wrong ? > Yes. Null is an unknown value, whereas returning no record is not unknown, it's just nothing. S

Re: [firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread Mr. John
Thanks all for your help,I'll review my code to fix that From: Lucas Franzen To: firebird-support@yahoogroups.com Sent: Wednesday, September 12, 2012 2:21 PM Subject: Re: [firebird-support] Strange SELECT FIRST 1   Am 12.09.2012 13:13, schrieb Mr. John:

[firebird-support] problem with restore

2012-09-12 Thread Sergio
Hello! I'm having a problem when I restore a database (just in case: the backup was made with -meta_data option) I'm getting this error message, but I can't find where is the RDB$INDEX_39. I use FlameRobin... gbak:restoring SQL role: RDB$ADMIN gbak: ERROR:attempt to store duplicate value

RES: [firebird-support] problem with restore

2012-09-12 Thread Fabiano
Analyze what field compounds the RDB$INDEX_39 indice. After restoring the database you will find out that you have duplicated values in this table. It is a slight corruption. You must delete the duplicated values and then active this index. Then make a full backup/restore cycle. Because of th

Re: RES: [firebird-support] problem with restore

2012-09-12 Thread Sergio
Thanks Fabiano! By mistake, I was using an old gbak with a 2.5 databse. With the correct gbak the problem in gone!!! By the way... How can seek that index? I did a metadata search with FlameRobin, but it returned nothing... Thanks again! -s --- "Fabiano" wrote: > > Analyze what field comp

RES: RES: [firebird-support] problem with restore

2012-09-12 Thread Fabiano
You MUST always use the same gbak version to make backups! Well I use IBExpert, I never used FlameRobin. In IBExpert I write the index name on a search box, then double click it and then IBExpert shows the table and indices that makes that indice. Fabiano De: firebird-support@yahoogroup

Re: RES: [firebird-support] problem with restore

2012-09-12 Thread Lucas Franzen
Am 12.09.2012 16:35, schrieb Sergio: > Thanks Fabiano! > > By mistake, I was using an old gbak with a 2.5 databse. With the correct gbak > the problem in gone!!! > > By the way... How can seek that index? I did a metadata search with > FlameRobin, but it returned nothing... RDB$INDEX_39 is an

Re: RES: [firebird-support] problem with restore

2012-09-12 Thread Mark Rotteveel
On Wed, 12 Sep 2012 14:35:15 -, "Sergio" wrote: > Thanks Fabiano! > > By mistake, I was using an old gbak with a 2.5 databse. With the correct > gbak the problem in gone!!! > > By the way... How can seek that index? I did a metadata search with > FlameRobin, but it returned nothing... > >

[firebird-support] mon$attachments versus fb_inet_server processes

2012-09-12 Thread Fabiano
Some strange things are occuring with my Firebird Classic 2.5.1 (Windows server 2008) right now: When I runs this statement (select count(*) from mon$attachments) it returns 113 connections to me but then I count the number of fb_inet_server.exe running process I reach the number 220! How b

[firebird-support] violation of FOREIGN KEY constraint

2012-09-12 Thread Rick Debay
ISC ERROR CODE:335544345 ISC ERROR MESSAGE: lock conflict on no wait transaction violation of FOREIGN KEY constraint "FK_RPLPO_REPLGRP" on table "RPL_PO" The relationship between parent and child was always valid, so I don't know why this error was raised. Can this occur if a column in th

Re: [firebird-support] mon$attachments versus fb_inet_server processes

2012-09-12 Thread Thomas Steinmaurer
> Some strange things are occuring with my Firebird Classic 2.5.1 (Windows > server 2008) right now: > > > > When I runs this statement (select count(*) from mon$attachments) it returns > 113 connections to me but then I count the number of fb_inet_server.exe > running process I reach the number 22

[firebird-support] Can't continue after bugcheck

2012-09-12 Thread Rick Debay
Rarely I'll get this error, and it goes away after recreating the connection. Neither gbak (backup & restore) nor gfix (validate) report errors. What should be my next steps?

[firebird-support] Re: Can't continue after bugcheck

2012-09-12 Thread Dmitry Yemanov
12.09.2012 19:42, Rick Debay wrote: > Rarely I'll get this error, and it goes away after recreating the > connection. > Neither gbak (backup & restore) nor gfix (validate) report errors. > What should be my next steps? Look at firebird.log and figure out the reason. It's logged right before you g

RES: [firebird-support] mon$attachments versus fb_inet_server processes

2012-09-12 Thread Fabiano
Well this computer (server database) has only this database and is exclusively used as a database server. All connections are made by a Delphi XE2 DataSnap server application, all them with SYSDBA user. I logged as SYSDBA user when running the select statement. Any other guess? De: firebi

RES: [firebird-support] Re: Can't continue after bugcheck

2012-09-12 Thread Fabiano
We have this same issue some times in our server. The solution is restart de database server – I never tested stop and start the Firebird process… De: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Em nome de Dmitry Yemanov Enviada em: quarta-feira, 12 de setembro

RES: [firebird-support] Re: Can't continue after bugcheck

2012-09-12 Thread Fabiano
We have this same issue some times in our server. The solution is restart de database server – I never tested stop and start the Firebird process… De: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Em nome de Dmitry Yemanov Enviada em: quarta-feira, 12 de setembro

Re: RES: RES: [firebird-support] problem with restore

2012-09-12 Thread Mark Rotteveel
On 16-9-2012 16:38, Fabiano wrote: ^^ Fabiano, You might want to check the date settings on your computer, it is set 4 days in the future. Mark -- Mark Rotteveel

RES: RES: RES: [firebird-support] problem with restore

2012-09-12 Thread Fabiano
Sorry, I correct this mistake. Thanks. De: firebird-support@yahoogroups.com [mailto:firebird-support@yahoogroups.com] Em nome de Mark Rotteveel Enviada em: quarta-feira, 12 de setembro de 2012 13:47 Para: firebird-support@yahoogroups.com Assunto: Re: RES: RES: [firebird-support] problem with r

Re: [firebird-support] RE: Stored Proc optimisation advice

2012-09-12 Thread Ann Harrison
On Wed, Sep 12, 2012 at 3:06 AM, Maya Opperman wrote: > > >>I have a stored proc that calculates account balances. Most of the time > it takes between 1-2 seconds, but every now and then it takes 22 seconds. > It seems to be approx. every 5 or 6 records. > > >>If I run the sub proc to get the bal

[firebird-support] Re: Migrate from 1.5 to 2.1 or 2.5: Which is the best choice?

2012-09-12 Thread Nando
Maya, Thank you for posting. I'll keep in mind your comments. Hernando.

Re: [firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread Ann Harrison
On Wed, Sep 12, 2012 at 6:18 AM, Mr. John wrote: > Hi,I'm using FB 2.5.1.26351 SS on XP SP3,I have one stored > procedure,also inside > FOR EXECUTE STATEMENT loop I have this query > > SELECT FIRST 1 id_cf,numar FROM CB_FC WHERE ID_CF=:wid_cf > AND numar=:wNUMAR INTO :xid_cf,:xnumar; > That

[firebird-support] How to create an calculated field for bank balance?

2012-09-12 Thread K Z
Hello, Is there a trick to have this? CREATE TABLE BANK_ACCOUNT ( ID INTEGER NOT NULL,   OCCURRENCE TIMESTAMP,   DESCRIPTION VARCHAR(100),   AMOUNT DECIMAL(10,2) NOT NULL CONSTRAINT PK_ BANK_ACCOUNT _1 PRIMARY KEY (ID) ); CREATE VIEW  BANK_ACCOUNT_STATEMENT (ID, OCCURRENCE , DESCRIPTION ,  

Re: [firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread Mr. John
Hi Ann,thanks for your tips,so   SELECT FIRST 1   is slower than simple SELECT ? Why to add ORDER BY ? Thanks ! From: Ann Harrison To: firebird-support@yahoogroups.com Sent: Wednesday, September 12, 2012 9:09 PM Subject: Re: [firebird-support] Strange SELECT FI

Re: [firebird-support] How to create an calculated field for bank balance?

2012-09-12 Thread Alexandre Benson Smith
Em 12/9/2012 15:28, K Z escreveu: > Hello, > > > Is there a trick to have this? > > CREATE TABLE BANK_ACCOUNT > ( > ID INTEGER NOT NULL, >OCCURRENCE TIMESTAMP, >DESCRIPTION VARCHAR(100), >AMOUNT DECIMAL(10,2) NOT NULL > CONSTRAINT PK_ > BANK_ACCOUNT _1 PRIMARY KEY (ID) > ); > > > > CREA

Re: [firebird-support] mon$attachments versus fb_inet_server processes

2012-09-12 Thread Helen Borrie
At 02:54 AM 17/09/2012, Fabiano wrote: >Some strange things are occuring with my Firebird Classic 2.5.1 (Windows >server 2008) right now: > >When I runs this statement (select count(*) from mon$attachments) it returns >113 connections to me but then I count the number of fb_inet_server.exe >runnin

Re: [firebird-support] How to create an calculated field for bank balance?

2012-09-12 Thread Ismael L. Donis Garcia
Because order by desc?. This would revert the order of the operations. = || ISMAEL || = - Original Message - From: K Z To: firebird-support@yahoogroups.com Sent: Wednesday, September 12, 2012 2:28 PM Subject: [firebird-support] How to create an calculated fiel

RES: [firebird-support] mon$attachments versus fb_inet_server processes

2012-09-12 Thread Fabiano
Helen, thanks for this advice. But, how can I found if I are using the Guardian? There is no other Firebird process running, only fb_inet_server.exe I also checked the running Windows Services and the only one is "Firebird Server - DefaultInstance". Fabiano. [Non-text portions of this mess

Re: [firebird-support] How to create an calculated field for bank balance?

2012-09-12 Thread K Z
Hello,  The ideia is that the first record is the most recent one. The last is the oldest. From: Ismael L. Donis Garcia To: firebird-support@yahoogroups.com Sent: Wednesday, September 12, 2012 8:40 PM Subject: Re: [firebird-support] How to create an calculat

Re: [firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread Ann Harrison
On Wed, Sep 12, 2012 at 3:25 PM, Mr. John wrote: > Hi Ann,thanks for your tips,so SELECT FIRST 1 is slower than > simple SELECT ? > Not in general, but why complicate things? > Why to add ORDER BY ? > That gives you a chance of getting the same record every time.Lets assume you have a

Re: RES: [firebird-support] mon$attachments versus fb_inet_server processes

2012-09-12 Thread Helen Borrie
At 08:17 AM 13/09/2012, you wrote: >Helen, thanks for this advice. > > > >But, how can I found if I are using the Guardian? There is no other Firebird >process running, only fb_inet_server.exe > >I also checked the running Windows Services and the only one is "Firebird >Server - DefaultInstance".

Re: [firebird-support] How to create an calculated field for bank balance?

2012-09-12 Thread Alexandre Benson Smith
Em 12/9/2012 18:02, K Z escreveu: > Hello, > > The ideia is that the first record is the most recent one. The last is the > oldest. > How to handle where what is the result of select * from Table and select * from Table where AccountId = 12 and select * from Table where AccountID = 12 an

[firebird-support] Problems with default values...

2012-09-12 Thread fidel_filio
Hello I'm having a problems with a couple of columns, when I try to set a default value here is my code... alter table cboo_pedido add fec_uactu date default 'today' not null, add hor_uactu varchar(2) default extract(hour from cast('now' as date)) not null The first column (fec_uactu) goes OK,

Re: [firebird-support] Problems with default values...

2012-09-12 Thread Helen Borrie
At 12:56 PM 13/09/2012, you wrote: >Hello I'm having a problems with a couple of columns, when I try to set a >default value here is my code... > > >alter table cboo_pedido >add fec_uactu date default 'today' not null, >add hor_uactu varchar(2) default extract(hour from cast('now' as date)) not >

Re: [firebird-support] Strange SELECT FIRST 1

2012-09-12 Thread Mr. John
Thanks Ann for your explanations ! From: Ann Harrison To: firebird-support@yahoogroups.com Sent: Thursday, September 13, 2012 12:21 AM Subject: Re: [firebird-support] Strange SELECT FIRST 1   On Wed, Sep 12, 2012 at 3:25 PM, Mr. John wrote: > Hi Ann,thank

[firebird-support] Get Installed Folder

2012-09-12 Thread Allan Fernandes
Hi, How can I get the folder where FireBird is installed. I use Delphi and I want to copy the UDF folder after a silent installation. Regards Allan [Non-text portions of this message have been removed]