Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> Re: Check user roles in trigger?

Re: Check user roles in trigger?

From: Daniel Morgan <damorgan_at_x.washington.edu>
Date: Fri, 02 Apr 2004 18:07:25 -0800
Message-ID: <1080958029.506614@yasure>


Dr Drudge wrote:

> OK, so what would the correct privs be?
> How can I assign rights to update-only-if-null (see above)?
> thanks

CREATE OR REPLACE TRIGGER only_if_null
BEFORE UPDATE
ON some_table
FOR EACH ROW DECLARE x VARCHAR2(100);

BEGIN
    dbms_application_info.read_client_info(x)     IF x = some_value AND :OLD.some_column IS NULL THEN       RAISE_APPLICATION_ERROR(-20001, 'What did you do?');     END IF;
END only_if_null;
/

For demos using dbms_application_info:
http://www.psoug.org/reference/dbms_applic_info.html

-- 
Daniel Morgan
http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp
http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp
damorgan_at_x.washington.edu
(replace 'x' with a 'u' to reply)
Received on Fri Apr 02 2004 - 20:07:25 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US