Reputation: 401
As mentioned in the title, is it possible to prevent the data in the table from being updated? I tried using the following trigger
CREATE OR REPLACE TRIGGER block_payment_update
BEFORE UPDATE ON payment
DECLARE
e_no_update_allowed EXCEPTION;
BEGIN
RAISE e_no_update_allowed;
EXCEPTION WHEN e_no_update_allowed THEN
dbms_output.put_line('Updating PAYMENT table is not allowed');
END;
I know that LOCK TABLE statement
with SHARE ROW EXCLUSIVE
can be used, but is there a possibility that it will also block inserting data to a table?
Upvotes: 0
Views: 993
Reputation: 212
Like the buddy who comment, you can REVOKE
update privileges in your database, here is an example.
REVOKE UPDATE ON table to <username>
Information that might be useful:
GRANT creates a permission rule
REVOKE removes a permission rule
Upvotes: 5