|
-
tks for response.
what about by using session details as like below
CREATE OR REPLACE TRIGGER bi_bu_emp
BEFORE INSERT OR UPDATE ON emp
FOR EACH ROW
BEGIN
IF INSERTING THEN
SELECT SYSDATE INTO :NEW.created_date FROM DUAL;
SELECT substR(machine,1,40) INTO :NEW.created_user FROM v$session WHERE sid = (SELECT sid FROM v$mystat WHERE rownum = 1);
ELSIF UPDATING THEN
SELECT SYSDATE INTO :NEW.modified_date FROM DUAL;
SELECT machine INTO :NEW.modified_user FROM v$session WHERE sid = (SELECT sid FROM v$mystat WHERE rownum = 1);
END IF;
END;
i granted the dba role to the dev schema.
I am getting result when i run the statement in sqlplus,
SELECT substR(machine,1,40) FROM v$session WHERE sid = (SELECT sid FROM v$mystat WHERE rownum = 1);
but when i run the same in trigger it give compilation error as
-------- ---------------------------------------------------------------
3/1 PL/SQL: SQL Statement ignored
3/94 PL/SQL: ORA-00942: table or view does not exist
pl. let me know what need to be done
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|