Hi All,
I would like to be able to store information in 2 different tables at the same time.
I also would like to be able to reset/overwrite the information in 1 table, but add the information in the 2nd table when new information is entered.
Can someone provide me with some guidance, please
Dream
[Solved] Store data simultaniously in 2 tables
-
- Posts: 881
- Joined: Mon May 30, 2011 4:02 am
[Solved] Store data simultaniously in 2 tables
Last edited by dreamquartz on Sat May 04, 2019 11:57 pm, edited 1 time in total.
LO 7.x, HSQLDB 2.7.x & Ubuntu 22.04 LTS.
Re: Store data simultaniously in 2 tables
Dual (concurrent) registration of same data is usually a bad idea.
If the purpose is to enable some kind of "rollback", transaction handling may be for you.
If you need a "recent history", add a timestamp field and create a "recent" query filtering on the timestamp.
You could also use an update/reset query, transferring data from the 1st (data entry) table to the 2nd., clearing the 1st table as you transfer data. To show all entries, you can use a query like TABLE1 UNION (ALL) TABLE2.
If the purpose is to enable some kind of "rollback", transaction handling may be for you.
If you need a "recent history", add a timestamp field and create a "recent" query filtering on the timestamp.
You could also use an update/reset query, transferring data from the 1st (data entry) table to the 2nd., clearing the 1st table as you transfer data. To show all entries, you can use a query like TABLE1 UNION (ALL) TABLE2.
Re: Store data simultaniously in 2 tables
It will help when you specify your question at "requirement" level and not at technical implementation level. For many "Requirements" there exists default solution patterns. Keme is guessing in his response what your requirements are.
P.S.
A technical answer can be "Use Triggers" your favorite enemy.
P.S.
A technical answer can be "Use Triggers" your favorite enemy.
It's Microsoft marketing that tells you computers are qualified for non-technicians
W11 22H2 (build 22621), LO 7.4.2.3(x64)
W11 22H2 (build 22621), LO 7.4.2.3(x64)
-
- Posts: 881
- Joined: Mon May 30, 2011 4:02 am
Re: Store data simultaniously in 2 tables
It's relatederemmel wrote:It will help when you specify your question at "requirement" level and not at technical implementation level. For many "Requirements" there exists default solution patterns. Keme is guessing in his response what your requirements are.
P.S.
A technical answer can be "Use Triggers" your favorite enemy.
It was a thought and could not find anything about it.
Dream
LO 7.x, HSQLDB 2.7.x & Ubuntu 22.04 LTS.