Trigger Trigger in Oracle

Source: Internet
Author: User

1 CREATE OR REPLACE TRIGGERTrgregisterpregroup2BeforeUPDATE3    ontblregisterusers4    forEach ROW5 6 DECLARE7sort_idvarchar2( -);8E_codeVARCHAR2( +);9 BEGINTen       IF: New.fldleftmoney<>: Old.fldleftmoney Then One         SelectTo_char (Systimestamp (3),'YYYYMMDDHH24MISSFF') intosort_id fromdual; AE_code:= NULL; -          forRinch(SelectA.fldusergroupid, - A.FLDX, the A.fldy, - A.fldz, - A.fldserviceaid, - A.fldservicebid, + A.fldservicecid, - A.flag +                    fromUsergroupautoconfig a A                  whereA.fldusergroupid=: New.fldusergroupid andA.flag=1) at Loop -             if: New.fldleftmoney>R.fldz Then -               ifR.fldservicecid is  not NULL  Then -E_code:=Pk_interface.user_pregroup (: NEW. Fldusername,r.fldservicecid,sysdate,9000, sort_id); -               End if; -elsif (: New.fldleftmoney<=R.FLDZ) and(: New.fldleftmoney>R.fldy) Then in               ifR.fldservicebid is  not NULL  Then -E_code:=Pk_interface.user_pregroup (: NEW. Fldusername,r.fldservicebid,sysdate,9000, sort_id); to               End if; +             Else -               ifR.fldserviceaid is  not NULL  Then theE_code:=Pk_interface.user_pregroup (: NEW. Fldusername,r.fldserviceaid,sysdate,9000, sort_id); *               End if; $             End if;Panax Notoginseng           EndLoop; -        End if; the     ifE_code<>Pk_common. E00 Then +Pk_public.error_log ('Trgregisterpregroup:' ||: New.flduserid|| '-' ||e_code); A         End if; the EXCEPTION +        whenOTHERS Then -         NULL; $ ENDTrgregisterpregroup;

Trigger Trigger in Oracle

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.