[firebird-support] Event handling, I think?

2019-11-22 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi all, is it possible to update a table when the current_date in rdb$database changes to the next day? I need to reset a delivery counter to 0 in all the orders on a system. I can presently do this two ways. When I print a delivery label I do it via a SP... cut-down start of SP select

[firebird-support] 1 single windows Pc cannot access database - all others Pcs on the network can.

2019-05-03 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi, I have a mixed environment of Win64 and Win32 Pcs targeting a Win64 server with various FB3.0.4 databases. It is a Firebird 32-bit version. (33054_0) I use Delphi 10.3 for the programs and Firedac for database access within the programs. All Pcs use the same programs resident on the

Re: [firebird-support] Using FB 3.04 with Delphi 10.2

2018-12-20 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
e: > On 20-12-2018 14:49, Alan J Davies alan.dav...@aldis-systems.co.uk > [firebird-support] wrote: > > Thanks John - spot on! I had the connection set correctly in the > > program's connection string but in Ibexpert (my database tool of choice) > > I had set it as Local to

[firebird-support] Using FB 3.04 with Delphi 10.2

2018-12-20 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi I use FB3.04 and Delphi for writing the front-end programs. I had no problems with FB 2.5 for years, but now I've upgraded I have problems every time I run a compile and run cycle. I get the error - "Error while trying to open the file - the process cannot access the file because it is being

Re: [firebird-support] Sequential auto incremental numbering

2018-09-02 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi Christian, this is a snippet from a long-time working version with several users creating invoices and no problems experienced. This invoice number is then available in Delphi. InvHeadInsert.ExecProc; locInv_Nmbr:=InvHeadInsert.Params.ParamValues['new_inv_nmbr']; There is

Re: [firebird-support] Inserting/Updating new records with data from previous records

2017-03-28 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Thanks Maya, it was a lot more complicated that that. I ended up creating a GTT plus a main SP for selecting the delivery notes required and calling a second Create SP for inserting into the GTT, then a third Clone SP for replicating that data - one record for each label, then another Update

[firebird-support] Inserting/Updating new records with data from previous records

2017-03-24 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi all, I hope you can help me with this. I have a customer who scans barcodes to produce delivery notes. There may be several barcodes per part to produce one line on the delivery note. The quantities can vary - if there is insufficient raw material or their customer needs them immediately.

Re: [firebird-support] New auto-increment column, existing data

2016-11-15 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
There are a few things missing from your setup. Try this; there may be other ideas for you too, but this works. create a new table CREATE TABLE A_AUTO_TEST ( NEW_FIELD INTEGER NOT NULL, SOME_DATA CHAR(10) ); ensure the field you want is the PK ALTER TABLE A_AUTO_TEST ADD CONSTRAINT

Re: [firebird-support] question about moving database from windows to linux

2016-02-26 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi Robert, I guess this is pretty well documented elsewhere on the Ibphoenix site, but you will face a number of issues, all quite easy to resolve. In no particular order you need to address: UDFs they are different and have a suffix .so, not .dll. visibility of the database - who 'owns' it is

Re: [firebird-support] string difficulty

2015-12-07 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi, using your code, how about left(:str, position('**' in :str)-1)); select left(:str, position('**' in :str)-1)) from yourtable However, to make things easier for future users, think about changing the single '*' to e.g. '-' and then you can keep your existing select statements and not have

Re: [firebird-support] How much percentage of a database space is a table contents taking.

2015-11-26 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi Robert, you need to click on the second tab of the results - Tables. The first tab - Text - does only show what you have here. TableName SizeUsage% CUSTOMER11,960,3200.295 PARAMFIL16,3840.000 POSTCODES3,903,012,86496.335

Re: [firebird-support] Replication SW experience

2015-11-26 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi Slavek, there are a number of issues you need to resolve before making a decision. If network performance is an issue then replication is not the answer - unless you can send the changes back to head office 'out of hours'. This means the different databases will be out of sync for some

Re: [firebird-support] How much percentage of a database space is a table contents taking.

2015-11-25 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi Robert, you can do this easily with a tool such as IBExpert. Just run Services / Database Statistics and this is the result: TableName SizeUsage% CUSTOMER11,960,320 0.295 PARAMFIL16,384 1 0.000 POSTCODES

Re: [firebird-support] FB 3.0

2015-11-10 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi, this is really off-topic here but these pointers will help. IBX components will show with way red lines underneath - everything from IBDatabase to IBQuery to IBStoredProc. Use Firedac, it works very well and if you are careful you can change all your e.g. IBqry1, IBqry2 to FBqry1, FBqry2

[firebird-support] Conditional where statements

2015-11-05 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi, I have a SP that has been running as is for many years on various servers and the performance is very acceptable. However, I have just replaced a dual Xeon test server with - wait for it! - a Raspberry PI 2 running a customised Linux OS. It runs perfectly well and I've benchmarked a number

Re: [firebird-support] Re: Firebird replication help needed

2015-10-09 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
This may sound harsh - if they won't pay just $150 then they can't value their data very much. Not a helpful answer but it may guide you on future business. Alan Alan J Davies Aldis On 09/10/2015 11:43, drci...@yahoo.com [firebird-support] wrote: > That doesn't help me, cos I need to install

Re: [firebird-support] Changing Columns

2015-07-03 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
I tried this in a test database before replying. Changed a domain from 4 to 8 char. This is used by various tables as a PK and got this error message. I then changed other domains to check and had no problems (done this many times before but possibly not with a PK, can't remember) This

Re: [firebird-support] Advice requested on design pattern

2015-05-20 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Another way of doing what you want would be to use SPs instead of Views. Then if you select * from SP and hide it as below, no-one can see what you are doing with the data. This works well and I drop this into every new database I work on. To repeat the warning though - make sure you have a

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

2014-11-15 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Yes, I see that now and understand the difference between sum(iif and iif(sum. Alan Alan J Davies Aldis On 15/11/2014 11:50, Svein Erling Tysvær svein.erling.tysv...@kreftregisteret.no [firebird-support] wrote: Thank you Svein, that's what I tried but kept getting: SQL error code = -104.

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

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

2014-11-13 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi, I have a question about summing data, as follows: NEW_TABLE CODEAMOUNT SELL_DATE 1 10 10.11.2014 2 20 10.11.2014 3 30 07.11.2014 1 100 11.11.2014 2 200 11.11.2014 2 200011.11.2014 1 150 10.11.2014 3 500

Re: [firebird-support] how to have different (conditional) order by clause with same select

2014-10-22 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Thanks Svein, , with the addition of : before (select iif(:index_by = 1, myfield1, myfield2), iif(:index_by = 1, myfield2, myfield1), myfield1, myfield2 from mytable) that does work exactly as I want. The reason for wanting the order by clause in the SP is because the database is queried from

[firebird-support] how to have different (conditional) order by clause with same select

2014-10-21 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi, I have a number of SPs with several joined tables, sub-selects and case statements. The only variation is the index or order by clause used. When user requirements change, I have to ensure that all the different SPs are updated (a Pain). Any help/advice would be welcome, thanks. Ideally,

[firebird-support] conditional select

2014-08-28 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi, I'm looking at a system that I have not touched for some years and wonder if there is a way to improve this code. This all works, but is there a better or more efficient way? I can't think of how to combine them into one 'where' statement. Basically I look for a part based on increasingly

Re: [firebird-support] conditional select

2014-08-28 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Thanks Svein, an ingenious use of distinct and nulls. It worked but not fully, so if I add this it does, but only because I pass a value from an external application and that would be '' as an empty parameter, not null. And you're right, :locsearchtype is not necessary. The database was a 1.5

Re: [firebird-support] Insert existing record into same table several times

2014-08-17 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi Thomas, thank you, it works perfectly. Alan Alan J Davies Aldis On 17/08/2014 06:47, Thomas Beckmann thomas.beckm...@assfinet.de [firebird-support] wrote: Hi Alan! The reason is very simple: The first select in your procedure is a singleton select, it can deal with one record only,

[firebird-support] Insert existing record into same table several times

2014-08-16 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi, I have a table similar to this simplified version. Test_table Id integer description char(15) quantity integer sequence_no integer - incremented by insert trigger and generator Id Description quantity sequence_no 1Beermat 11 2Beer Mug 32 3Whisky Glass 1

[firebird-support] Extracting check values from domain

2014-08-08 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Hi, can anyone help me with the following please? As an example, I have a domain - YES_NO - with strangely enough only Y or N acceptable as input. I then use this domain in various tables. In Delphi I then check if 'Y' or 'N' is entered before trying to write to the database. Yes, I know the

Re: [firebird-support] Extracting check values from domain

2014-08-08 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
Thanks Martijn, that works perfectly. I've added some code for anyone who finds this useful. This extracts the domain name and the corresponding values. This can then be used anywhere; Delphi, C++ etc. with a 'Select * from domain_extract' create or alter procedure domain_extract returns (

Re: [firebird-support] Aliases and Windows Host - any

2014-05-27 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
: Hi ! Em 26/5/2014 21:17, Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support] escreveu: I'm trying to do that exactly but cannot make it work. I'm using Win7, FB 2.5.1 on host (server) and Win7 on client. The application is running in Delphi XE2 and works perfectly on host

Re: [firebird-support] Aliases and Windows Host - any

2014-05-26 Thread Alan J Davies alan.dav...@aldis-systems.co.uk [firebird-support]
I'm trying to do that exactly but cannot make it work. I'm using Win7, FB 2.5.1 on host (server) and Win7 on client. The application is running in Delphi XE2 and works perfectly on host client when I do the following (as I have since Delphi5): In the application folder I have the database, the