Hi,

I have been using a sequence and a trigger to insert a primary key value in to a table.

I have now come accross a problem where I need to insert the primary key after the row has been updated.

I have been using the following code

CREATE OR REPLACE TRIGGER "PAUL".""BEFORE
INSERT ON "PRODUCTS" FOR EACH ROW BEGIN
IF :new.PRODUCT_ID IS NULL THEN
SELECT AUTO_PRODUCT_ID.NEXTVAL
INTO :new.PRODUCT_ID
FROM dual;
END IF;
END;

When I try to use this code I get the following message.

OraOLEDB error '80004005'
ROW-00014: Cannot update row as the data in the database has changed

Can you help?

For those that may know. I am trying to use ASPUPLOAD to insert a file into my database,

Thanks for your help in advanced.

Regards,

Paul