Hi all,
I have an issue I need a little advice on. What I have is:
a table MY_TABLE, with fields; ID, DATE, PIECES
ID is the key. What I need to work out is, ID being the key, what is the best way to allow incremental updates to the PIECES field if the ID already exists and the date is different in the table.
For Example:
When new data comes in, if the ID is in the database, I need to check to see if the date coming in is different than the date in the existing record, if it is I need to increment the PIECES field, otherwise raise an error.
Existing Data In Table
ID DATE PIECES
10 2/2/2001 10
Incoming Data
10, 2/4/2001, 15
Final Result in Table
ID DATE PIECES
10 2/2/2001 35
I appreciate any help. Thanks,
Bill
I have an issue I need a little advice on. What I have is:
a table MY_TABLE, with fields; ID, DATE, PIECES
ID is the key. What I need to work out is, ID being the key, what is the best way to allow incremental updates to the PIECES field if the ID already exists and the date is different in the table.
For Example:
When new data comes in, if the ID is in the database, I need to check to see if the date coming in is different than the date in the existing record, if it is I need to increment the PIECES field, otherwise raise an error.
Existing Data In Table
ID DATE PIECES
10 2/2/2001 10
Incoming Data
10, 2/4/2001, 15
Final Result in Table
ID DATE PIECES
10 2/2/2001 35
I appreciate any help. Thanks,
Bill