Dave,

<If, for whatever reason, an insertion should fail I'd not want to remove
the
entry records.>

set and check the error var or check sqlcode for the select section for the
insert select command for failure and alert you of the failure and do not
perform the removal of the detail.  (If you are concern about machine or os
failure during the operation then your structural definition comes into play
and how to check your data integrity.)

<How can I verify that all records were inserted, or do I
need to be worried about it at all?>
I would retain the detail but reset a status bit column showing that it has
been inserted into the main table.  keep the history.

I have a AR (invoice) routine that I create the detail in a detail table
then insert this information to a sold table that is a combination of
items(ar sales and cash sale for all inventory items).  I have a entryno for
the detail table and have a IDno for the sold table.  That give me a unique
column for the solddetail and entry detail but they are not the same.  I
also insert the entry no from the detail table for checking purposes to keep
duplicated entries from occurring!  I have routines that check for entries
that don't belong in the solddetail and check the match in the cash and ar
detail tables for any omissions!  I do this checking as part of the daily
backup.

If you don't want any detail in your entry table then append it to a history
table and delete the detail in the entry table after the insertion into your
main table.  That way you can compare the two tables for any items that may
have been missed.  But I've found that the insert select works with out
error if your where clause is defined correctly.


Best regards,

Oma






Reply via email to