[Solved] Store data simultaniously in 2 tables

Discuss the database features

[Solved] Store data simultaniously in 2 tables

Postby dreamquartz » Sun Apr 21, 2019 8:46 pm

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
Last edited by dreamquartz on Sat May 04, 2019 11:57 pm, edited 1 time in total.
LO 6.x and OO 4.x on Windows 7 PRO & Ubuntu 18.04 LTS.
dreamquartz
 
Posts: 710
Joined: Mon May 30, 2011 4:02 am

Re: Store data simultaniously in 2 tables

Postby keme » Mon Apr 22, 2019 1:04 pm

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.
User avatar
keme
Volunteer
 
Posts: 3234
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Store data simultaniously in 2 tables

Postby eremmel » Tue Apr 23, 2019 9:55 pm

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's Microsoft marketing that tells you computers are qualified for non-technicians
eremmel
 
Posts: 1037
Joined: Tue Dec 30, 2008 1:15 am

Re: Store data simultaniously in 2 tables

Postby dreamquartz » Sat May 04, 2019 11:56 pm

eremmel 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's related :bravo:

It was a thought and could not find anything about it.

Dream
LO 6.x and OO 4.x on Windows 7 PRO & Ubuntu 18.04 LTS.
dreamquartz
 
Posts: 710
Joined: Mon May 30, 2011 4:02 am


Return to Base

Who is online

Users browsing this forum: No registered users and 3 guests