473,405 Members | 2,282 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

Storing updates?

Hi all

I have a database that stores customer records and their associated
insurance details. I need to be able to track any changes made to that
record within a set time period ie if details are changed fine it is
reported next time report is run. But if details are changed more than
once in between reports then first detail change is lost.

I would like to work out a way that changes can be written to a
??seperate version of the table?? and stored in there to be reported
seperately and not just the final change as is the snapshot nature of a
report? Is this possible? Could I possible make another version of the
main table appended onto it? I feel I 'know' what I need to do but not
how to even begin it! Any help would be appreciated.

DDiver

Nov 13 '05 #1
5 1487
One of Ralph Kimball's books, The Data Warehouse Toolkit, has a reference
design for a data warehouse for an insurance company. The schema given in
this book will do exactly what you want. The book is $30.00 US or so and
well worth the money. The schema may have been published by Kimball in an
article on the web but I don't have a URL for you.

--
Alan Webb
kn*******@SPAMhotmail.com
"It's not IT, it's IS
<dd*****@yahoo.co.uk> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Hi all

I have a database that stores customer records and their associated
insurance details. I need to be able to track any changes made to that
record within a set time period ie if details are changed fine it is
reported next time report is run. But if details are changed more than
once in between reports then first detail change is lost.

I would like to work out a way that changes can be written to a
??seperate version of the table?? and stored in there to be reported
seperately and not just the final change as is the snapshot nature of a
report? Is this possible? Could I possible make another version of the
main table appended onto it? I feel I 'know' what I need to do but not
how to even begin it! Any help would be appreciated.

DDiver

Nov 13 '05 #2
There's even a new version out... I have the old one... trudging my way
through it... was supposed to take a class in it for my duhgree, but
I'm told the class was "probably the worst one I've had here" by one of
my classmates. (And why do we pay tuition again?)

Nov 13 '05 #3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

How is your db set up? Do you have more than one table? It sounds like
you'd, at least, need a Personnel table to hold the demographic info
about customers (name, address, DOB, etc.), and a table of their
insurance contracts. E.g.:

CREATE TABLE Contracts (
person_id int not null references Personnel ,
contract_type int not null references ContractTypes ,
start_date datetime not null ,
end_date datetime null , -- null means still active
-- other columns
CONSTRAINT PK_Contracts
PRIMARY KEY (person_id, contract_type, start_date)
)

The Contracts table has a start_date & end_date, this will allow you to
make a history of the person's contracts. If you need to track
something else about a specific contract you can create another table
that has that info w/ start/end dates. That table would be a history of
changes to contracts.

Obviously, you can keep on creating tables as your specifications become
more particular. Read a good book on database design. I usually
recommend _Database Design for Mere Mortals_, by Hernandez.

--
MGFoster:::mgf00 <at> earthlink <decimal-point> net
Oakland, CA (USA)

-----BEGIN PGP SIGNATURE-----
Version: PGP for Personal Privacy 5.0
Charset: noconv

iQA/AwUBQkwxioechKqOuFEgEQJ8NACfT5nai8lUYVoy/czk90lzJPB3KmYAnik1
M+1WmyhRgMGSxO6Hq7xcBBvH
=vHEx
-----END PGP SIGNATURE-----

dd*****@yahoo.co.uk wrote:
Hi all

I have a database that stores customer records and their associated
insurance details. I need to be able to track any changes made to that
record within a set time period ie if details are changed fine it is
reported next time report is run. But if details are changed more than
once in between reports then first detail change is lost.

I would like to work out a way that changes can be written to a
??seperate version of the table?? and stored in there to be reported
seperately and not just the final change as is the snapshot nature of a
report? Is this possible? Could I possible make another version of the
main table appended onto it? I feel I 'know' what I need to do but not
how to even begin it! Any help would be appreciated.

Nov 13 '05 #4
Here's what I did in one of my applications:

1. I created a copy of each table that I wanted to track, with an extra
date/time field called DateModified. I prefixed these tables' names
with hst, so the archive table for tblClients would be hstClients. You
do need a system to make sure the table definitions say up-to-date.

2. I created a procedure like the following to archive the new version
of a changed record in a form:

Public Sub ArchiveRecord(fForm As Form, HistTable as string)
Dim rForm As Recordset, rHist As DAO.Recordset
Dim fld As Field
On Error GoTo ErrHandler

' Copy new data to history table
Set rForm = fForm.RecordsetClone
If rForm.RecordCount <> 0 Then
rForm.Bookmark = fForm.Bookmark 'find record shown in form
Set rHist = AdminDB.OpenRecordset(HistTable)

rHist.AddNew
' Use history table for reference of which fields to use,
' since form might be based on query
For Each fld In rHist.Fields
fld = rForm.Fields(fld.Name)
Next
rHist.Update
End If
ExitLabel:
On Error Resume Next
rHist.Close
rForm.Close
Set rHist = Nothing
Set rForm = Nothing

Exit Sub

ErrHandler:
' <error handling code here>
Resume ExitLabel
End Sub

3. In the after update of the form (e.g. for the table tblClients):
ArchiveRecord Me, "hstRatesGeneral"

If I were to write this today, I might generate and execute a SQL
statement, instead of using the AddNew method. But this works fine.

Jerry

Nov 13 '05 #5
Peit Linden,
We pay tuition so we can get the books and hear from the professors the
orthodox way to do things. The demands of our clients and the realities of
business requirements often mean that the orthodox way isn't what we end up
doing. But it's a lot worse to flounder through a project thinking our
problems are new and unique than to study what is already known and decide
to flounder through anyway.
--
Alan Webb
kn*******@SPAMhotmail.com
"It's not IT, it's IS

<pi********@hotmail.com> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
(And why do we pay tuition again?)

Nov 13 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Steve | last post by:
Hi all i am just starting to get back into VB and i need a little help. I am writing a program that asks a user to type in a set of numbers/letters (in this case shipping containers). Once the...
1
by: bloy.d | last post by:
Hi, I'll be honest I'm a newbie at all this and I'm need to get a small JS working as soon as possible - please can anybody help? I have a small insentive if needed ;) What i need is a spot...
3
by: hamvil79 | last post by:
I'm implementig a java web application using MySQL as database. The main function of the application is basically to redistribuite documents. Those documents (PDF, DOC with an average size around...
3
by: John Gibson | last post by:
Hi, all. I have a table which is continually updated with the latest totals. I would like to take snapshots of some of the data in that table and store it in a second table to run statistics on...
1
by: screenwriter776 | last post by:
Hi, folks - I have a control on a form that needs to store a single user-entered (currency) amount, and store that amount for the next time another user opens the form and views/updates it. ...
6
by: Shannan Casteel via AccessMonster.com | last post by:
I'll explain as well as possible...not an experienced user...but learning. I am working on a database for different kinds of problems with machines. A user will be able to select a problem...
0
by: Dave Friedel | last post by:
I read through the WS2 samples but I am still fuzzy on how to access the settings I need to validate my users passwords. Specifically, I do not know how to tell which hostheader is being accessed...
5
by: Demetri | last post by:
Unfortunately, where I work it is forbidden to use stored procedures. I know, I know...it's pretty stupid. But I can not change that. Anyway, currently we have our sql stored in an embedded resx...
14
by: John Welch | last post by:
Hi all. I'm creating a FE/BE database that will be used by about 6 users. As usual, I have several fields, such as "OrganizationTypeID" that will get values (via combo boxes in forms) from separate...
2
by: Regnab | last post by:
I'm creating a database that will be used independently at different sites (in the same company). Given the fact that there will be inevitable changes down the track, I'm trying to work out the...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.