>I have two tables with a one to many relationships. I have set buffer mode to 5 on the detail table. I want to execute code to update a field within the record that is currently updated on the insert trigger. The field will hold an unique number that I will assign as each record is updated. I am doing this since I want the number I assign to run in sequence with no gaps and the number is alphanumeric.
>However, when I try to replace the field with the value I have generated i get a message that the cursor is readonly.
>
>How can I replace the value of the current record being updated (I use Tableupdate command) before the physical update is executed without getting the readonly record?
>
>Thanks in advance.
>
>Stuart
Stuart,
It is impossible to update a field in a table in its trigger. ( You can update other tables, but not the table that fired that trigger)
The only place to update the record is in its table validation rule, which fires before the triggers
A way to detect new records in the table validation is - if memory serves - to check the oldval('field') which will be null - supposing nulls are not allowed for your field
Gregory