Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: triggers
I want to clarify what I meant by:
> 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?
I want to get the trigger to write to my table when the entry is made and I want it to update my table when chages are made.
thanks,
> thanks
"Choung" <cchao_at_pmc.ca> wrote in message
news:Jybfc.27050$kc2.387848_at_nnrp1.uunet.ca...
> 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
>
>
Received on Wed Apr 14 2004 - 09:17:09 CDT