| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: Replication
Another possibility: don't use the quote number as a key. Assign some other value as the
primary key that none of the sales staff (or whoever) use for their reference -- it should be
used by the DBMS only. Then your applications look for all rows with the quote number (build
appropriate nonunique indexes for this column). All the history is in the base table and is
retrievable (and replicatable or archivable by quote number). You will get duplication of
rows in other tables with FK relationships to rows of a particular quote, and your
applications will have to create the new rows in the dependent tables for each update to the
quote in the parent table, but your data will be much easier to replicate in this case. To
ensure that you always update/view the most current quote, add a timestamp column for the
SELECT ...
Michael
Graham Bellamy wrote:
> "Hugh O'Neill" <hugh.oneill_at_btconnect.com> wrote in message
> news:3CF41670.A9D005E2_at_btconnect.com...
> <snip>
> > > No, I was referring to the situation of revisions of things like quotes, which is
> really a
> > > revision 'history'. Say the salesman submits a quote to his client, using say Quote
> number
> > > 1001, and his client calls back and asks for some of the criteria to be modified,
> maybe
> > > for a cheaper product to be used. One option could be to go back and change the stored
> > > data, but then there is no way the salesman could later see the price he originally
> > > quoted. Another option is that the salesman must create a new quote number, say 1007,
> and
> > > write on quote 1001 a reference like "see revision quote #1007". But a nicer way of
> > > keeping track of which revision is which, is to keep the same quote number, 1001, and
> add
> > > a revision number, 2, to make it 1001-2, or with the salesman's initials, BJ1001-2.
> > > Anyway, what this means is that the majority of fields would be duplicated (getting
> away
> > > from a normalised db), which is probably an idiosyncracy of storing histories. Maybe
> > > another way (thinking on the fly here) is to create identical tables (maybe split up)
> with
> > > a 1-1 relationship to the original tables, to store the changes. But I think that
> would be
> > > a nightmare. Having never handled this situation of revising data before, I was
> wondering
> > > if there was some general way this is done.
> > >
> > > Hope I explained this ok.
> > >
> >
> > Well that simply means that you have your table of quotations details versions in a
> table
> > separate from that containing the quotation number and put them in a many-to-one
> relationship
> > (one quote number - many versions). This may well consist mainly of pointers to data in
> other
> > tables (customer, products, etc.).
>
>
>
>
>
>
>
![]() |
![]() |