All the changes made in this table are stored in a table called H_PRODCUT
H_PRODUCT table has this columns: Operation, date, product_id, event_id, field, value.

Operation = I (Insertion), U (is an Update), D ( the product is Deleted)
Date = Date and time of the operation.
procuct_id = the id of the product.
field = contains the field changed in an operation. If field is not
updated, it is not registered.
value = New value of the field.
event_id = if more than one field is modified (description, price, quantity) there will be more than one register with the same product_id and event_id, because they are updated in the same operation, if not each operation has his own event_id.

When a product is new, H_PRODUCT will have a register for each field. Then I've all the information.

When a product is updated, H_PRODUCT will have only an operation field for the fields modified. Not all fields and values are stored.

When a product is deleted H_PRODUCT will have only an operation register with one field.

The problem is when a product is updated because only the new fields/values are stored.

I know that it's possible obtain the info with SQL but, I think that this is not very clean. it's possible do it doing something like this?

For example:

1. Do a DataSet, getting the insertion data and store the values of all the current fields in global variables
2. Do a DataShet getting the updated data and check with birt if there is a register with the field, if not put in the report the current value of the global variable for the field. If the field is in datashet store the new value in the global variable and put in the report the new value.
3. Do a DataShet getting the deleted data of the product. Get the fields values as in second step.