Union of tables

Claes

New Member
Hi,

We got this pattern in our database of storing data that split data into two tables a current and a history. If a want to fetch a specific date of this data I have to look in both the current table and the history table. No one knows any more why this pattern was used, probably to limit table size.

This pattern leads to very complex code, quite unnecessary. I'm about to write some new programs and would like to solve this. Changing the database isn't an option we got tons of code.

I tried using a sql view and union which work fine in SQL but wasn't accessible through 4gl and for each... Has anybody a clue?

Best regards Claes
 
I recommend you to use temp-table view as business-logic layer and write 1 procedure which converts db layer to business layer.
(extracts data to temp-table from history and actual tables).
 
Back
Top