WHENEVER SQLERROR EXIT SQL.SQLCODE

CREATE OR REPLACE DATA GRANT mac_account_owner
  AS SELECT
  ON dds_mac_accounts
  WHERE owner_name = ORA_END_USER_CONTEXT.username
  TO account_owner_role;

CREATE OR REPLACE DATA GRANT mac_accounts_view_broad
  AS SELECT
  ON dds_mac_accounts_view
  TO account_owner_role;

BEGIN
  EXECUTE IMMEDIATE 'SET USE DATA GRANTS ONLY ON dds_mac_accounts ENABLED';
END;
/
