Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: triggers
Choung wrote:
> Hi,
>
> I have this trigger:
>
> CREATE OR REPLACE TRIGGER "SYS"."LICENSE_USAGE"
> BEFORE DELETE OR UPDATE
> ON "ADMUSER"."USESSION"
> FOR EACH ROW BEGIN
>
> INSERT INTO admuser.licenseaccess (user_id, session_id, login_time,
> last_active_time)
> values(:OLD.user_id,:OLD.session_id, :OLD.login_time,
> :OLD.last_active_time);
>
> update admuser.licenseaccess
> set user_name =
> (select user_name from admuser.users
> where user_id = licenseaccess.user_id);
>
> update admuser.licenseaccess
> set named_user_flag =
> (select named_user_flag from admuser.usereng
> where user_id = licenseaccess.user_id and db_engine_type = 'PM');
>
> END;
>
> This triggers works but I'm trying to get the trigger to write to my table
> when there has been an entry made. I don't want any duplicates either. Any
> suggestions?
>
> thanks
Why is it owned by SYS?
-- 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 Thu Apr 15 2004 - 01:52:38 CDT