0 votes
in Oracle by
Write an Oracle SQL query to ensure only users with the manager role can insert rows into the performance_reviews table.

1 Answer

0 votes
by
CREATE OR REPLACE TRIGGER enforce_manager_insert

BEFORE INSERT ON performance_reviews

FOR EACH ROW

DECLARE

BEGIN

  IF NOT (IS_ROLE_ENABLED('manager')) THEN

    RAISE_APPLICATION_ERROR(-20001, 'Only users with the "manager" role can insert into this table.');

  END IF;

END;

Related questions

+1 vote
asked Dec 3, 2020 in Hive by sharadyadav1986
0 votes
asked Nov 25, 2021 in Oracle by DavidAnderson
...