Re: [firebird-support] Potential for improvements / optimization for the use case below?

2020-04-02 Thread Patrick Marten patrick_mar...@yahoo.com [firebird-support]
Thank you for your reply, Lester. I came across CTE during my research, but wasn't sure it was the right thing for this case. Looked more detailed into it and came up with this: with TOTAL_STOCKS as (   select PRODUCTID, STORAGE_AREA_ID_SOURCE, sum(AMOUNT) as TOTAL_STOCK   from

[firebird-support] Potential for improvements / optimization for the use case below?

2020-04-02 Thread Patrick Marten patrick_mar...@yahoo.com [firebird-support]
Greetings, I've the following table: CREATE TABLE STOCK_RECORDS (   ID                                    INTEGER                    NOT NULL,   LOCATION                            SMALLINT,   INSERTUSER                        SMALLINT                    DEFAULT 0,     <-- FOREIGN KEY

[firebird-support] Missing system triggers for foreign key constraints

2019-08-06 Thread patrick_mar...@yahoo.com [firebird-support]
Greetins all, I'm dealing with a customer database (FB 2.5.2), which seems to be missing several system triggers for foreign key constraints. He has been receiving the ISC ERROR CODE:335544466 with the message -- violation of FOREIGN KEY constraint "XXX" on table

[firebird-support] Re: After update trigger: the same values for new.somefiled and old.somefield

2016-08-29 Thread patrick_mar...@yahoo.com [firebird-support]
Hi guys, thanks for the suggestions and ideas, it helped to track it down. It was not directly another trigger or procedure updating the record in question, but something similar : I had altered an existing trigger. There was an if-block checking a field A for being not null and executing

Re: [firebird-support] After update trigger: the same values for new.somefiled and old.somefield

2016-08-27 Thread patrick_mar...@yahoo.com [firebird-support]
> Use "IS DISTINCT" instead of "<>". I've tried this too already - still no difference... Some other comparisons with other fields in the same trigger seem to work fine even with '<>', this one doesn't...

[firebird-support] After update trigger: the same values for new.somefiled and old.somefield

2016-08-27 Thread patrick_mar...@yahoo.com [firebird-support]
Hello, shouldn't the values of new.somefield and old.somefield be different in an after update trigger, when the value of that field has definitely changed? For some reason they both have the new value and I can't figure out why. If I didn't misread all the articles, I've found, completely,

[firebird-support] Truncated part of the previous message

2016-01-04 Thread patrick_mar...@yahoo.com [firebird-support]
[...] if (PROCESSED_AMOUNT_INVOICES is null) then begin PROCESSED_AMOUNT_INVOICES = 0; end PROCESSED_AMOUNT_INVOICES = PROCESSED_AMOUNT_INVOICES + TempTargetAmount; end else begin PROCESSED_AMOUNT_INVOICES =

[firebird-support] DROP CONSTRAINT only shows effect after commit?

2014-08-28 Thread patrick_mar...@yahoo.com [firebird-support]
Hello, any attempt to do a search ends with the screen Oops! Polls feature not enabled for some reason, so I have to ask directly: Is it correct, that a commit is required after some contraints have been removed, before I can do some data changes which would violate those constraints?

Re: [firebird-support] DROP CONSTRAINT only shows effect after commit?

2014-08-28 Thread patrick_mar...@yahoo.com [firebird-support]
Hello Martijn, thank you very much for the quick response. Best regards, Patrick

[firebird-support] Joint result of master (columns) and up to 3 details (detail rows as columns)

2014-07-24 Thread patrick_mar...@yahoo.com [firebird-support]
Hello, I hope the title says more or less what I would like to achieve. For a better overview I've made two screenshots. That's the given structure (3 tables): http://www.pic-upload.de/view-24012442/01_given_structure.png.html http://www.pic-upload.de/view-24012442/01_given_structure.png.html