Trigger code

hai,
i want code for a trigger that dispalys number of working days for employee in a
employee table where startdate and end date are available and should grouped by month.

May be something like this?
ops$mportes@FCCUAT9I> var dtini varchar2(20)
ops$mportes@FCCUAT9I> var dtend varchar2(20)
ops$mportes@FCCUAT9I>
ops$mportes@FCCUAT9I> exec :dtini := '01/01/2006'
PL/SQL procedure successfully completed.
DTINI
01/01/2006
ops$mportes@FCCUAT9I> exec :dtend := '31/12/2006'
PL/SQL procedure successfully completed.
DTEND
31/12/2006
ops$mportes@FCCUAT9I>
ops$mportes@FCCUAT9I> with
  2  d
  3  as ( select to_date(:dtini, 'dd/mm/yyyy') + level-1 dt
  4         from dual
  5      connect by level <= to_date(:dtend, 'dd/mm/yyyy') - to_date(:dtini, 'dd/mm/yyyy')
  6     )
  7  select to_char(dt, 'MON-yyyy') month, count(*) cnt
  8    from d
  9   where to_char(dt, 'd') not in (1, 7) -- you have to put holidays as well
10   group by to_char(dt, 'MON-yyyy')
11  /
MONTH              CNT
APR-2006            20
AUG-2006            23
DEC-2006            21
FEB-2006            20
JAN-2006            22
JUL-2006            21
JUN-2006            22
MAR-2006            23
MAY-2006            23
NOV-2006            22
OCT-2006            22
SEP-2006            21
12 rows selected.

Similar Messages

  • How to Create a trigger code for turning on light bulbs in flash and animate images professional cs6

    hi,
        i designed a very interactive music website in illustrator and photoshop and i am trying to animate the main page design in flash professional and eventually publish it as HTML5. There are couple of questions i need to ask before starting
    1) should i import my design in differnet layers from illustrator into flash professional in order to make it easier to isolate and animate specific parts of the web page?
    2) i want to have a roll over effect that allows certain features in the page to turn on and off when the mouse hovers over them. can you explain how to do that? any tutorial videos i could follow
    3) what format should i use when importing my illustrator design into flash professional
    4) how should i animate the content pop out from the safe box into the main screen in flash professional (i have never used this program before, so i will be going off video tutorials and whatever suggestions/help you would have)
    **The idea is to have a content frame fly out of the safe into the screen (the size will increase rapidly and it will fade into the screen as well while rotating 360 degrees for one revolution). The content is a basic rectangular frame i designed in illustrator. The body of this frame will be transparent allowing me to embed the main page features into it eg music, videos, bio etc. All this will be done in the later process, the main issue is figuring out how to animate the content frame into the screen and also creating a click feature that allows the content to fly back into the safe and then the safe closing in.
    Secondly, the trigger code rollover effect that allows certain features light to turn on when the mouse hovers over it and turn over when its not.****

    I think you'll get most flexibility by turning on the feature that lets you keep your Illustrator layers as Flash layers. You'll also want to check the box that lets you make an Illustrator object into a MovieClip for anything that you want to interact with or address through code.
    Add an event listener for MOUSE_OVER that triggers whatever functions you need to create to turn on the features. This means that your object that you will mouse over will need to be a MC, as well as any other objects that will be addressed (for example, calling play()) will need to be a MC. You'll want to have a matching MOUSE_OUT handler that stops MC's, hides them, or whatever.
    You should probably organize your Illustrator file so that the objects you need to address are on their own layers. This includes nested objects. Name things informatively. Remember, if the first import doesn't give you exactly what you want, you don't have to save the change--you can edit your settings or the Illustrator file and try again.
    Look into motion tweens. I highly recommend the books "How to Cheat at Flash" and "Animation with Scripting." I don't really think the way they tell you to script will advance your career if you want to be a software architect, but if you just want to animate the occasional widget, it's fine.

  • SQLDeveloper 3.2 - I can't see trigger code

    Hi people
    In some cases, I can't see trigger code.
    I didn't find a pattern to determine what kind of trigger has an invisible code.
    For example, in my instance I can't see code of SCOTT.AFTER_INS_UPD_ON_EMP trigger, but I see it in SQL tab for SCOTT.EMP table.
    I had to copy from there and recreate trigger. Now is visible
    I work with EBS R12, and a list of some triggers with that problem follows:
    AR_RECEIVABLE_APPLICATIONS_BRI
    AS_JTF_RS_GROUP_MEM_BI
    FND_FLEX_VAL_RULE_LINES_T1
    FND_FLEX_VALIDATION_RULES_T1
    FND_SECURITY_GROUPS_IL
    HR_LOCATIONS_ALL_OVN
    PAY_TEMPLATE_EXCLUSION_RUL_WHO
    PER_ALL_PEOPLE_F_OVN
    PER_PERSON_ANALYSES_OVN
    PER_PSV_OVN
    WIP_DISCRETE_JOBS_BRD
    My info:
    SQL Developer 3.2.09.30
    Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bit
    Thanks
    Oscar

    Hi Oscar,
    Possibly your issue may be the same as this very recently logged and fixed bug:
    Bug 14530780 - TRIGGERCODE IN OTHER SCHEMA NOT VISIBLE IN BROWSER, HOWEVER QUERIABLE IN SQLWORK
    But the bug narrative never claims it is a regression, so presumably it also would have been a problem in prior releases.
    Regards,
    Gary

  • How to get trigger code from the schema into a file

    Please help me in getting code of any trigger from the schema, without using any data dictionary views.

    In fact you can get the trigger code by using tools like toad,sql developer
    But all are using the data dictonary view to get the code .

  • SDDM Beta 3.3 trigger code generation

    If you are generating PL/SQL trigger code in Oracle 11gR2 you can replace the following the SQL SELECT statement with a straight next value sequence number assignment. It is cleaner, easier to read and debug.
    ---- old way start
    CREATE OR REPLACE TRIGGER address_type_Address_Type_ID
    BEFORE INSERT ON Address_Type
    FOR EACH ROW
    WHEN (NEW.Address_Type_ID IS NULL)
    BEGIN
    SELECT address_type_Address_Type_ID.NEXTVAL INTO :NEW.Address_Type_ID FROM DUAL;
    END;
    ---- old way end
    ---- new way start
    CREATE OR REPLACE TRIGGER address_type_Address_Type_ID
    BEFORE INSERT ON Address_Type
    FOR EACH ROW
    WHEN (NEW.Address_Type_ID IS NULL)
    BEGIN
    :NEW.Address_Type_ID := address_type_Address_Type_ID.NEXTVAL;
    END;
    ---- new way end

    Hi Scott,
    Thanks for suggesting this. I've logged an enhancement request.
    David

  • How can we wrap trigger code?

    Hi,
    I m unable to wrap the trigger code.
    WRAP utility does not works for trigger.
    Any other solution.
    Thanks in Adv.

    WRAP utility does not works for trigger.Right, as it explained into the doc : Limitations of Obfuscation :
    "The wrapping does not obfuscate the source code for triggers. To hide the workings of a trigger, you can write a one-line trigger that calls a wrapped procedure."
    Nicolas.

  • Report Trigger Code in Data Template

    Hello all,
    I've inserted a report trigger into a data template and created the required function in my database. Everything works as expected.
    My question is, is there any way to write the report trigger within the data template? Given the choice, I'd rather have the trigger code embedded within the data template itself rather than existing in a separate package.
    I've found no examples of this, but I just wanted to confirm that it can't be done.
    Thanks.
    Edited by: jasonr on May 17, 2011 7:39 AM

    No,
    The code to be executed by trigger will be a PL/SQL package, and it will reside in DB only.

  • Isn't this Trigger code error prone?

    Version: 10g Release 2
    I have come across a Trigger code where the :NEW pseudo variable is being assigned value like
    SELECT emp_oid into :new.emp_oid FROM emp_dtls WHERE EMP_NO =:NEW.EMP_OID;Apparently, the code is working fine. But isn't this error prone?

    It is not very useful to post this single line. One doesn't even know on which table this trigger fires, nor the relationship with the affected table and the emp_dtls table, nor whether an exception handler was programmed.
    (Probably not).
    If my assumption is correct no exception handler was programmed, this would have resulted in kick-ass time, as the code may result in either the NO_DATA_FOUND exception or the TOO_MANY_ROWS exception.
    Anyone writing that kind of code needs to be escorted to the door of unemployment immediately.
    BTW will anything bad happen if you post a question consisting of more than 1 line. Salary substracted? Fingers chopped off by your boss?
    Sybrand Bakker
    Senior Oracle DBA

  • Trigger code abending after OPEN_FORM in 10g

    Has anyone encounted this? I am having a problem with a 10g form with When-Button-Pressed trigger code containing a OPEN_FORM(form_name, NO_ACTIVATE, SESSION) statement. It is supposed to open the child form, then transfer control back to the parent form to perform additional processing, then transfer control to the child form using GO_FORM. The code stops processing following successful completion of the OPEN_FORM statement, leaving the parent form with focus. When I click on the child form, I get a user-defined error, as the statement immediately following the OPEN_FORM statement in the parent form provides the child form with the information it needs, and that statement never executes.
    We are in the process of converting from 6i to 10g, and the code works fine in 6i. I set the form to display debug messages in both versions, and they are largely identical until the last few trigger calls.
    In 6i, Item-, record- and block-level processing occurs until a When-New-Form-Instance trigger is fired on the child form, followed by the typical When-New...Instance triggers. Next, a When-Forms-Navigate fires on the child form, followed by Post... and Pre... triggers at the record and block level. Then a When-Forms-Navigate fires on the parent form. Item-level processing follows on the parent form, then a When-Window-Deactivated on the parent form, followed by a When-Window-Activated on the child form, at which time, control is at the child form.
    In 10g, processing is nearly identical to 6i until the When-New...Instance triggers fire in the child form. A When-Forms-Navigate trigger then fires, but it's on the parent form, not the child form. Control never leaves the parent form, and the statements after the OPEN_FORM do not get executed, so control does not pass to the child form.
    If anyone has insight as to what causes this, I'd greatly appreciate it.

    That sounds like a possible bug to me. You should contact Oracle Support and have them analyze and log a bug if necessary.

  • How to call the client side procedure...with trigger code

    hi
    i have made a client side procedure with one IN PARAMETER having datatype number. i call this procedure through a button in which i declare a CURSOR
    (all_emp)...so in the BEGIN SECTION i make a loop as (FOR e IN all_emp LOOP) and then call the client side procedure as CALC_EMP_PR_ALW_DED(e.emp_id); but here the error show that is statment ignored....
    so plz help me that where i am wrong.... here is the trigger code
    working in forms 6i...
    IF SHOW_LOV('LOV_EMP') THEN
         NULL;
    END IF;
    DECLARE
         CURSOR all_emp IS
                   SELECT DISTINCT e.emp_id
                   FROM alw_ded ad,emp_alw_ded ead,emp e
                   WHERE NVL(ead.status,'A') = 'A'
                   AND NVL(e.stat,'A') = 'A'
                   AND ead.ad_id = ad.ad_id
                   AND e.emp_id = ead.emp_id
                   AND ead.emp_id = :CON_BLK.emp_id;
    BEGIN
              FOR e IN all_emp LOOP
                   CALC_EMP_PR_ALW_DED(e.emp_id);
              END LOOP;
    END;
    thankx in advance

    yes i did same and i send u the procedure code as... now i wnt to use these
    PROCEDURE CALC_EMP_PR_ALW_DED(P_EMP_ID IN NUMBER) IS
    v_basic NUMBER; --Basic Pay of employee
    v_l_p CHAR(1); -- Percentage or Lump sum
    v_amount NUMBER; -- Amount or value of Allow/ded/contr
    v_max_limit NUMBER;
    v_type NUMBER; -- Allow/ded/cont          
    v_b_g CHAR(1); -- Basic or Gross
    v_min_limit NUMBER;
    v_emp_id NUMBER;
    v_user Varchar2(20);
    v_gross NUMBER;
    v_max_amount NUMBER; -- DEDUCTION ACTUAL AMOUNT NOT MAX
    up_limit NUMBER;
    new_amt number;
    CURSOR all_alw_ded IS
         SELECT ad.abbre,ead.ead_id,e.emp_id,descrip,l_p,ad.amount,nvl(ad.max_limit,0) max_limit,b_g,ad.type,nvl(ad.min_limit,0) min_limit
                   FROM alw_ded ad,emp_alw_ded ead,emp e
                   WHERE NVL(ead.status,'A') = 'A'
                   AND NVL(ad.TYPE,'A') = 'A'
                   AND ead.ad_id = ad.ad_id
                   AND e.emp_id = ead.emp_id
                   AND e.emp_id = P_EMP_ID;
    BEGIN
              SELECT USER
              INTO v_user
              FROM
              DUAL;
                   FOR e IN all_alw_ded LOOP
                                  IF e.type = 'A' THEN
                                  new_amt := Trunc(e.amount);
                                  ELSE
                                       new_amt := Round(e.amount);
                                  END IF;
                             IF e.l_p = 'P' AND e.b_g = 'B' THEN
                                  v_basic := nvl(HRPR.EMP_BASIC(e.emp_id),0);
                             END IF;          
                                       SELECT nvl(BASIC_PAY,0) INTO v_basic FROM EMP WHERE EMP_ID=P_EMP_ID;
                                       IF NVL(e.max_limit,0) > 0 THEN
                                            up_limit := nvl(((v_basic * nvl(e.amount,0))/100),0);     
                                            IF up_limit > e.max_limit THEN
                                                 v_max_amount := nvl(e.max_limit,0);
                                       --     v_max_amount :=100;
                                            ELSE
                                                 v_max_amount := ((nvl(v_basic,0) * nvl(e.amount,0))/100);
                                            END IF;
                                            ELSE
                                                 v_max_amount := ((nvl(v_basic,0) * nvl(e.amount,0))/100);
                                                 --     v_max_amount :=200;
                                            END IF;
                             IF e.l_p = 'P' AND e.b_g = 'G' THEN -- %AGE AND GROSS... CHECK NOT PRESENT...?? AHSAN 10-09-05
                                  v_gross := HRPR.EMP_GROSS(e.emp_id);
                                  IF e.type = 'A' THEN
                                       new_amt := Trunc((v_gross * e.amount)/100);
                                  ELSE
                                       new_amt := Round((v_gross * e.amount)/100);
                                  END IF;
                             END IF;
                   END LOOP;
              END;
    -- END; ------- PROCEDURE END

  • 3rd party license - trigger code seed

    Hello all
    My application is to give demo softwares to clients 
    - So i installed 3rd party licensing and activation  tool kit
    - Then i opened the project sampled licensed application.lvproj
    - As per the instructions given i tested the builted app in evaluation mode and it is working fine for 30 days 
    - Now My question is how to make this evaluation mode to work for a specific no of days . 
    - In the sampled licensed application.lvproj i opened the Init.vi and worked on trigger code seed with the help of 
       http://www.softwarekey.com/help/plusman/Concepts/C​oncepts_EZ_Trigger.htm
    - But i could not understand this codes how to integrate in labview and make my app to work for specific no of day

    When a third party order is saved for items to be delivered by the vendor, a purchase requisition is created in the background, which is then converted to purchase order. In your case you have CMIRs for various customers neverthless if the Material is shipped only by the vendor then you can have the Item usage in the CMIRs and have a item category determination configured for this combination, which will determine a third party item category for these CMIR material when is used in third party orders, that triggers a purchase requisition.

  • Set stage overflow from trigger code

    Cannot figure out how to change the value of overflow from trigger code. I can't even read it.
        alert(sym.getComposition().getStage().css("overflow"));
    No code in the trigger after the above line will run. Lines before run.
    Using this link as reference, I thought I could do this:
        sym.getComposition().getStage().css("overflow","visible");
    I tried using an intermediate variable. No dice. Any ideas?

    Use like this:
         sym.getComposition().getStage().getSymbolElement().css("overflow","visible");
    hth,
    Vivekuma

  • Trigger Code being truncated

    SQL Developer Version 1.5.0.53 running on XP attaching to Oracle 9.2. For some triggers all I get is 'create or replace'. Some triggers I get all the code.
    Mike

    I haven't seen this at all. I've got XP and same sqldeveloper versions, but going against Oracle 10g2.
    Just curious:
    - do you get the same behaviour when you look at the triggers both ways - that is 1st using the Triggers option in the treeview, and 2nd using the Tables option in the treeview and looking at the Trigger tab
    - can you see the trigger code in the worksheet when you run
    select text from user_source where name = 'MY_BIUR_TRG'
    Trish

  • .oam file of html5 video trigger code not working in Muse

    I simply want to have a video play on page load. I have done the code for a trigger on one <div> to automatically play a video in Edge. The video plays perfectly in browser preview, even with transparency intact! Just the way I want it. The problem is when I insert .oam file in Muse it doesn't work. Other animations of simple objects and key frames work fine in Muse. But, I can make much more beautiful animations for certain elements in After Effects, with transparency and integrate them with elements in Muse. The video, its transparency and other objects work great from Edge to browser preview but not when .oam file is exported and placed into Muse. I know, I wouldn't build an entire site like this, I just want one or two animations to play automatically, with out controls (which I've been able to do), when the page is loaded.
    I publish with business catalyst to a my own domain, with Creative Cloud.
    Attached is a video where I'm at.
    What is the code or method to get to work?

    HI,
    Ok. I know that mov is not supported in Firefox nor Chrome, now.
    When I put the trigger in Edge to play the .mov file, it works when I preview from Edge to Safari, and not in any of the other browsers. This leads me to think that Safari supports .mov files, with and without transparency.
    However, when I try to put the .oam file generated by Edge into Muse and run the page in Safari the video doesn't work. Is this a .mov support with Muse? Does the video need to be uploaded to the Adobe Business Catalyst server? Where I publish my site?
    .mov and transparency aside, I can't get any video to play in any browser from the .oam file placed in Muse. Nothing plays in preview nor when I publish in Muse. I get the previews to work from Edge for the corresponding video for each browser. And yes, when controls in put in it says wether the video is supported or not. But I would want no controls and the video to play automatically on page load. Ideally I would like transparency. But I realize that's a browser support thing.  I don't see why all browsers don't support all video types and WITH transparency. C'mon now it's almost 2014! Am I right or am I right? Ok, sorry.
    I followed everything in this Tom Green video. Pretty sure all my code is correct.
    http://layersmagazine.com/embedding-video-in-adobe-edge-animate.html
    Picture shows code for working .ogv in Edge preview but not from .oam file in Muse in preview nor publish.
    Not sure why it won't even show in preview from Muse. But thinking when I publish, the video must have to be local on the publish server right?
    Am I missing something? Do I need to insert HTML into Muse, not the .oam?

  • How can i minimize this  trigger code

    Hi,
    I've written the following trigger ,based on the requirement...
    Requirement is following:
    After updating the src table(EMPS) corresponding data need to be replicated to dest (REP_EMPS)
    While UPDATING ('STATUS') the following conditions to be matched
    *(1) updating from any char to 'V then modtp= 'I' AND 'D'*
    *(2) updating from 'V r to any char then modtp= 'I' AND 'D'*
    *(3) ANY TO ANY THEN modtp='U'*
    *(4) while deleting modtp='D'*
    So the following trigger is working fine ..
    But my doubt is can i even be minimize the code so as to achieve the requirement
    CREATE TABLE TEST.EMPS
      EMPNO   NUMBER,
      ENAME   VARCHAR2(11 BYTE),
      STATUS  CHAR(1 BYTE)
    CREATE TABLE TEST.REP_EMPS
      ENO    NUMBER,
      ENM    VARCHAR2(11 BYTE),
      STS    CHAR(1 BYTE),
      MODTP  CHAR(1 BYTE)
    )Trigger:
    CREATE OR REPLACE TRIGGER TEST.EMP_UDAR1
    AFTER UPDATE OR DELETE
    OF ENAME,STATUS
    ON TEST.EMPS  REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    DECLARE
    nmodtp char(1):='U';
    omodtp char(1):='D';
    nempno EMPS.EMPNO%TYPE:=:NEW.EMPNO;
    oempno EMPS.EMPNO%TYPE:=:OLD.EMPNO;
    nename EMPS.ENAME%TYPE:=:NEW.ENAME;
    oename EMPS.ENAME%TYPE:=:OLD.ENAME;
    nstatus EMPS.STATUS%TYPE:=:NEW.STATUS;
    ostatus EMPS.STATUS%TYPE:=:OLD.STATUS;
    docon number:=0;
    dodiscon number:=0;
    BEGIN
    IF (UPDATING('STATUS') AND (:NEW.STATUS='V' OR :OLD.STATUS='V')) THEN
      docon:=1;
      nmodtp:='I';
    ELSIF (NOT DELETING) THEN
      docon:=1;
    END IF;
    IF DELETING or (UPDATING('STATUS') AND (:NEW.STATUS='V' OR :OLD.STATUS='V')) THEN
      dodiscon:=1;
        END IF;
    INSERT ALL
    WHEN (docon=1) THEN
    INTO REP_EMPS(ENO,ENM,STS,modtp)
    VALUES(nempno,nename,nstatus,nmodtp)
    WHEN (dodiscon=1) THEN
    INTO REP_EMPS(ENO,ENM,STS,modtp)
    VALUES(oempno,oename,ostatus,omodtp)
    SELECT nempno AS nempno,
           oempno AS oempno,
           nename AS nename,
           oename AS oename,
           nstatus AS nstatus,
           ostatus AS ostatus,
           nmodtp AS modtp,
           omodtp AS modtp
    FROM DUAL;
    END;
    /i tried with following in the if condition but not getting the required output
    IF (UPDATING('STATUS') AND (:NEW.STATUS='V' OR :OLD.STATUS='V')) THEN
      docon:=1;
      nmodtp:='I';
    ELSIF (DELETING) or (UPDATING('STATUS') AND (:NEW.STATUS='V' OR :OLD.STATUS='V')) THEN
      dodiscon:=1;
    ELSE
      docon:=1;
    END IF;thank you,
    josh.....

    Hope this helps you
    create or replace
    TRIGGER EMP_UDAR1
    AFTER UPDATE OR DELETE
    OF ENAME,STATUS
    ON EMPS  REFERENCING NEW AS NEW OLD AS OLD
    FOR EACH ROW
    DECLARE
    -- no need to declaer other variables here.
    nmodtp char(1):='U';
    omodtp char(1):='D';
    docon number:=0;
    dodiscon number:=0;
    BEGIN
      IF (UPDATING('STATUS') AND (:NEW.STATUS='V' OR :OLD.STATUS='V')) THEN
        docon:=1;
        nmodtp:='I';
      ELSIF (NOT DELETING) THEN
        docon:=1;
      END IF;
      IF DELETING or (UPDATING('STATUS') AND (:NEW.STATUS='V' OR :OLD.STATUS='V'))
      THEN
        dodiscon:=1;
      END IF;
    INSERT ALL
        WHEN (docon=1) THEN
          INTO REP_EMPS(ENO,ENM,STS,modtp)
          VALUES(:New.empno,:New.ename,:New.status,:New.modtp) -- Use the :NEW.column values available
        WHEN (dodiscon=1) THEN
          INTO REP_EMPS(ENO,ENM,STS,modtp)
          VALUES(:OLD.empno,:OLD.ename,:OLD.status,:OLD.modtp)-- Use the :OLD.column values available
    SELECT *  FROM DUAL; -- You can do this
    END;

Maybe you are looking for