If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
i have a table datatable with 2 columns ...now my requirement is that no one should be able to delete data from that table including the owner of that table ..
i tried creating a trigger on datatable
create trigger restrict_delete no cascade before delete on datatable for each row mode db2sql
db2inst1 sounds like the default instance owner. Even if you revoke his privileges, he can still get to everything. So why would you do it. Besides, you cannot revoke privileges from yourself. And why would you want to ..!?
that's what i know db2inst1 is the default user and i cant revoke his privilege but the requirement is that no one should be able to insert into the table and once a record is inserted it should be deleted .
how do i achieve it ?
well i have been able to achieve it this is possible you can create a trigger on that table so that even the db2inst1 cant delete anything ...but if db2inst1 deletes the trigger then he can delete it directly
here is the trigger
CREATE TRIGGER DEL_TRIGGER
BEFORE DELETE ON LOGTABLE
FOR EACH ROW
SIGNAL SQLSTATE '42832'