"Write once" table column?

  • I want to INSERT data into a table with a column called "WriteOnceReadOnly". So after the data is inserted by a program I want to make the column effectively "read only" to the same program. The only way I can think of doing this is to create UPDATE, DELETE triggers on that column and reject all attempts to modify it. How would you approach this?

    TIA,

    Barkingdog

  • How are inserts/updates/deletes being done? Are you using Stored Procedures or Ad Hoc sql in the application? Do you have control over how it is done?

    The first thing I'd do, if I had the necessary control, is modify an application accessing that data so that the application does not provide a means to modify or delete rows with this column set. If I couldn't do that I'd put the logic in stored procedures and have the app use the stored procedures for modify/delete operations. If I couldn't do that then I'd go the trigger route.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply