Good evening really thank you for your time, I tell you I have an expense table with several fields like idgasto, vendor, client, total and one more detail_gasto that has fields idgasto, idproduct until everything is fine, but the application is web and for some information controls, I am using trigger then, I decided to create a temporary table where it has the same fields as detail_expend except idgasto for the trigger to clone the data from there to detail_gas after spending insert. The problem is how I tell the trigger to clone the data and put the corresponding id in the field idgasto .. .I hope to have been clear and again thank you