UTL_SMTP package not working in trigger

Hello Friends,
I have created a trigger through which i am trying to send a mail.but it gives an error message as:
ORA-30678: too many open connections
Also when i run the same script at the SQL Prompt, it will send the email to mentioned recipients.
Please help me in resolving this issue...
Thanks in advance,
Ankur

> I have created a trigger through which i am trying to send a mail
That is a very wrong approach to use. The purpose of a trigger is to protect data integrity. It is not a do-everything-with-it-including-washing-the-windows tool.
A trigger can submit a DBMS_JOB that in turn will do an e-mail shot. A trigger can insert an e-mail request into a table (queue) for a DBMS_JOB to pick up and process.
But a trigger that performs external functions (like sending mail, accessing the o/s command line, etc) compromises the business transaction - and make it dependant on external and non-related factors to make it succeed. What if the e-mail address is wrong? What if the POP mailbox of the recipient is full/ What if the mail server is down for 5 minutes maintenance? What if that specific network router/gateway/switch is down?
Fail the business transaction because of the trigger attempting to do what it is not suppose to do?
External functions have no place in a trigger.

Similar Messages

  • GO_ITEM is not working in trigger WHEN_VALIDATE_ITEM

    GO_ITEM is not working in trigger WHEN_VALIDATE_ITEM
    Here is my code...
    IF TRIGGER_NAME = 'WHEN_VALIDATE_ITEM' THEN
    FND_MESSAGE.DEBUG('Error!);
    GO_ITEM('abc.xyz');
    END IF
    After I clicked 'OK' on the message the GO_ITEM doesn't point to the desire item.
    Thanks.

    that's moroe than easy. Raise Form_Trigger_Failure :-)
    WHEN-VALIDATE-ITEM :
    BEGIN
      IF TRIGGER_NAME = 'WHEN_VALIDATE_ITEM' THEN
        FND_MESSAGE.DEBUG('Error!);
        IF something_goes_wrong THEN
          RAISE FORM_TRIGGER_FAILURE;
        END IF;
        One_Time_Timer.Initialize (Const.ott_Query);
      END IF
    EXCEPTION
      WHEN FORM_TRIGGER_FAILURE THEN
        RAISE;
    END;
    [(pre]
    try it
    Gerd                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • Need to re-install CS5.5 on my new hard drive. Serial number from disk package not working.

    I need to re-install CS5.5 on my new hard drive. Serial number from disk package not working.

    if there's a problem with the number of installations, you'll see a message about an excess activation problem.
    if that's what you're seeing, contact adobe support for an activation count reset, https://helpx.adobe.com/contact.html
    otherwise, attach a screenshot of the error message or quote it.

  • SCCM 2012 Primary Site Recovery - Packages not working

    I recently had to recover my Primary Site due to system crashes with blue screens on a daily basis. I was running ConfigMgr 2012 SP CU 3 and as part of the process I migrated from WS2008 R2 to WS2012 R2.
    After many hours of perusing the web, I found the solutions to deal with the common site recovery issues such as SSL certs, and the content validation due to an empty ContentLib folder. I also had the issue with the update source where it listed the old
    WSUS 3.2 server and the new one so the Site GUID was also updated.
    The issue I am currently experiencing is that packages new or old including software update packages are not working. When using the script by Peter VanWoulde it lists the Deployment State as Error. I have tried redistributing them, valdiating the content,
    removing distribution points, adding in new distribution points and even recreating some of the smaller packages to test but nothing is working.
    Application deployments are working without issues.
    This is the tail end of the WindowsUpdate.log file
    2013-11-20 22:03:27:281 1632 a84 COMAPI >>--  RESUMED  -- COMAPI: Search [ClientId = CcmExec]
    2013-11-20 22:03:28:098 1632 a84 COMAPI   - Updates found = 176
    2013-11-20 22:03:28:098 1632 a84 COMAPI ---------
    2013-11-20 22:03:28:098 1632 a84 COMAPI --  END  --  COMAPI: Search [ClientId = CcmExec]
    2013-11-20 22:03:28:098 1632 a84 COMAPI -------------
    2013-11-20 22:03:32:139 1020 980 Report CWERReporter finishing event handling. (00000000)
    This is the UpdatesDeployment.log file
    Assignment {FD1118D2-563C-44D4-99DB-0CBE29C5C01A} has total CI = 432 UpdatesDeploymentAgent 21/11/2013 8:31:14 AM 4572 (0x11DC)
    Deadline received for assignment ({FD1118D2-563C-44D4-99DB-0CBE29C5C01A}) UpdatesDeploymentAgent 21/11/2013 8:31:14 AM 4572 (0x11DC)
    Detection job ({F5229872-7A7E-4692-B709-63989F708AF0}) started for assignment ({FD1118D2-563C-44D4-99DB-0CBE29C5C01A}) UpdatesDeploymentAgent 21/11/2013 8:31:14 AM 4572 (0x11DC)
    Progress received for assignment ({FD1118D2-563C-44D4-99DB-0CBE29C5C01A}) UpdatesDeploymentAgent 21/11/2013 8:31:26 AM 4572 (0x11DC)
    EnumerateUpdates for action (UpdateActionInstall) - Total actionable updates = 0 UpdatesDeploymentAgent 21/11/2013 8:47:50 AM 3588 (0x0E04)
    EnumerateUpdates for action (UpdateActionInstall) - Total actionable updates = 0 UpdatesDeploymentAgent 21/11/2013 8:47:51 AM 3588 (0x0E04)
    EnumerateUpdates for action (UpdateActionInstall) - Total actionable updates = 0 UpdatesDeploymentAgent 21/11/2013 8:47:55 AM 3588 (0x0E04)
    EnumerateUpdates for action (UpdateActionInstall) - Total actionable updates = 0 UpdatesDeploymentAgent 21/11/2013 8:47:55 AM 2908 (0x0B5C)
    At this point I am running out of ideas of where to look.

    Hi Xin,
    Sorry for not responding earlier but I did recover the site using the guidelines in the following article Backup and Recovery in Configuration Manager,
    however there were a few issues. 
    I did not have a ContentLib backup so all the content had to be redistributed and validated before that worked. None of my packages new or old would work. I eventually found an article from a forum member who also initiated a Site Reset as part of their
    recovery process and had no issues.
    So it seems that any packages are still not working and i think I narrowed it down.
    For some reason even though my DP and MP are all set for HTTPS, it is trying to access the HTTP path for SMS_DP_SMSPKG$. I am using PKI certs so this is the correct path but it should be HTTPS.
    Excerpt from log.
    Retrying DoUpdateSourceListAll task SrcUpdateMgr 09/12/2013 2:26:51 PM 3140 (0x0C44)
    Product {16A45552-A143-4EE6-8CA4-8D95FB5EEB7E} is installed for user  SrcUpdateMgr 09/12/2013 2:26:51 PM 3140 (0x0C44)
    Adding 2 local DPs and 0 remote DPs for product {16A45552-A143-4EE6-8CA4-8D95FB5EEB7E} SrcUpdateMgr 09/12/2013 2:26:51 PM 3140 (0x0C44)
    Adding install source C:\Windows\ccmcache\5l\ to source list for product {16A45552-A143-4EE6-8CA4-8D95FB5EEB7E} SrcUpdateMgr 09/12/2013 2:26:51 PM 3140 (0x0C44)
    UpdateURLWithTransportSettings(): OLD URL - http://xxxxx.com/sms_dp_smspkg$/p01000ae SrcUpdateMgr 09/12/2013 2:26:51 PM 3140 (0x0C44)
    UpdateURLWithTransportSettings(): HTTP requested but client settings prohibit it. SrcUpdateMgr 09/12/2013 2:26:51 PM 3140 (0x0C44)
    Failed source list update for product {16A45552-A143-4EE6-8CA4-8D95FB5EEB7E}, error 87d00226 SrcUpdateMgr 09/12/2013 2:26:51 PM 3140 (0x0C44)
    DoUpdateSourceListAll task failed, error code 87d00226 SrcUpdateMgr 09/12/2013 2:26:51 PM 3140 (0x0C44)
    Source list update task failed, will be retried after 3600 seconds SrcUpdateMgr 09/12/2013 2:26:51 PM 3140 (0x0C44)
    MSI update source list task finished successfully SrcUpdateMgr 09/12/2013 2:26:51 PM 3140 (0x0C44)

  • Import scenario package not working

    Hi exports,
    On a test environment i created a scenario which i now would like to transfer to another server.
    I exported the correct scenario, but on the other server, the import is not working.
    I can submit my package, it shows that there is no current version of this package, but hitting the "IMPORT" button doesnt do anything.
    Im using (on both servers) SAP B1 9.0 pl 08 with the same integration framework.
    Any idea's on how to solve this?
    Kind regards
    Frederik

    Hi Radosla,
    Yep, thx for the hint.
    Looks like i put it on th test server in compatibility mode, but not on the real server.
    Changing this with F12 to IE 8 did the trick!
    Regards
    Frederik

  • [SOLVED] Rosgarden package not working

    Hi everybody,
    it's my first post here, so I hope I get all things done.
    I installed the new version of Rosegarden (10.02; i686 architecture) for the first time yesterday evening. I wanted to check out its features.
    Rosegarden's package information:
    http://www.archlinux.org/packages/extra … osegarden/
    I usually start programs via the Bash. But when starting Rosegarden this error occurs:
    [user@asterix ~]$ rosegarden
    rosegarden: symbol lookup error: rosegarden: undefined symbol: _ZN9QListData7detach3Ev
    It seems that there's something (a package?!?) missing.
    I installed Rosegarden with Pacman:
    [2010-02-15 19:37] synchronizing package lists
    [2010-02-15 19:41] installed liblrdf (0.4.0-6)
    [2010-02-15 19:41] installed liblo (0.26-1)
    [2010-02-15 19:41] installed dssi (1.0.0-3)
    [2010-02-15 19:41] installed rosegarden (10.02-1)
    According to Rosegarden's package information the following packages are required (the missing one were installed by Pacman itself; in brackets the installed version):
    - fftw (3.2.2-1)
    - qt (4.5.3-4)
    - liblrdf (0.4.0-6)
    - dssi (1.0.0-3)
    - ladspa (1.13-2)
    - liblo (0.26-1)
    - lirc-utils (0.8.6-3)
    - shared-mime-info (0.71-1)
    I've searched for previous errors:
    http://bbs.archlinux.org/viewtopic.php?id=82791
    There's no relation to my problem.
    It would be great if someone has a clue what to do. I hope all necessary information were mentioned.
    Thanks.
    Last edited by Schwefelsaeure (2010-02-17 23:20:30)

    Hi,
    sorry for my late reply, but I was busy the all day long.
    Thank you 'drcouzelis' for the tip to build Rosegarden on my own (with ABS).
    The building process took a while on my old AMD Athlon XP 1900+ but it works now.
    Unfortunately I don't know what went wrong before. It's the first package (within Pacman) which does not work since I've been using Arch Linux (about three years now).
    Arch Linux is a great distribution with a great and helpful community.
    Thanks for support.

  • Package not working

    I migrated from JDK1.3 to JDK1.4. Paths are set to bin and even classpath is set to c:\jdk1.4\lib;. The program is compiling and running fine.
    The problem I come across is that when I use Packages in my program the program would not compile showing that package so and so does not exist and cannot resolve symbol etc. Even the programs that I compiled when I had ver1.3 doesn't seem to compile in JDK1.4. My platform is win2000 Professional. Please help me regarding this.

    Thank you for your advice. It went wrong in setting the class path. I set it to c:\j2se1.4.0\lib; This created the problem. I removed this line in the Environment settings and package is working fine now. Thank you for your suggestion anyway.
    Yours friendly,
    Saravana Kumar. J

  • Why is the second procedure in my package not working??

    Hi I have a package that I want to run every 15 minutes. When I try to run the procedures manually and each one seperately they work. But when I put together these procedures in a package, the second procedure does not work or not updating the table. Any idea why this is creating a problem??
    PROCEDURE UPDATE_CS_ACTIVITY is the one in the below package that does not seems working .. but when i run the procedure manually it works fine.
    Any help in this regard is greatly appreciated...
    Thanx in advance
    Here is the Package code:
    CREATE OR REPLACE PACKAGE BODY UPDATE_ACTIVITY AS
    CSREWORK NUMBER(4);
    CSTRACKOUT NUMBER(4);
    STARTDATE VARCHAR2(20);
    ENDDATE VARCHAR2(20);
    PROCEDURE INSERTVALUES IS
    BEGIN
    DELETE FROM 2DAY_ACTIVITY;
    IF SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),12,2) > 18
    THEN
    STARTDATE := '18:30:00';
    INSERT INTO 2DAY_ACTIVITY(STAGESTEPPROD,RESOURCES,CSTRACKOUT)
    SELECT "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES",COUNT(TRACKOUTTIME)
    FROM "ACT_1DAY_VIEW" "ACT_VIEW"
    GROUP BY "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES" WHERE "ACT_VIEW"."TRACKOUTTIME" > SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),1,10)||' '||STARTDATE AND ISREWORKSTEP = 'F';
    INSERT INTO WAFER_2DAY_ACTIVITY(STAGESTEPPROD,RESOURCES,CSREWORK)
    SELECT "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES",COUNT(TRACKOUTTIME)
    FROM "ACT_1DAY_VIEW" "ACT_VIEW"
    GROUP BY "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES" WHERE "ACT_VIEW"."TRACKOUTTIME" > SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),1,10)||' '||STARTDATE AND ISREWORKSTEP = 'T';
    COMMIT;
    ELSE
         STARTDATE := '06:30:00';
         INSERT INTO 2DAY_ACTIVITY(STAGESTEPPROD,RESOURCES,CSTRACKOUT)
    SELECT "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES",COUNT(TRACKOUTTIME)
    FROM "ACT_1DAY_VIEW" "ACT_VIEW"
    GROUP BY "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES" WHERE "ACT_VIEW"."TRACKOUTTIME" > SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),1,10)||' '||STARTDATE AND ISREWORKSTEP = 'F';
    INSERT INTO 2DAY_ACTIVITY(STAGESTEPPROD,RESOURCES,CSREWORK)
    SELECT "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES",COUNT(TRACKOUTTIME)
    FROM "ACT_1DAY_VIEW" "ACT_VIEW"
    GROUP BY "ACT_VIEW"."STAGESTEPPROD","ACT_VIEW"."RESOURCES" WHERE "ACT_VIEW"."TRACKOUTTIME" > SUBSTR(TO_CHAR(SYSDATE,'MM/DD/YYYY HH24:MI:SS'),1,10)||' '||STARTDATE AND ISREWORKSTEP = 'T';
         COMMIT;
    END IF;
    END INSERTVALUES;
    PROCEDURE UPDATE_CS_ACTIVITY AS
    BEGIN
    INSERT INTO CS_ACTIVITY(STAGESTEPPROD, RESOURCES, CSTRACKOUT, CSREWORK) select MAX(stagestepprod),MAX(resources), max(cstrackout) ,max(csrework) from 2day_activity group by 2DAY_ACTIVITY.stagestepprod,2DAY_ACTIVITY.resources;
    COMMIT;
    END UPDATE_CS_ACTIVITY;
    END UPDATE_ACTIVITY;

    You have create global variables CSREWORK and CSTRACKOUT
    in your package.
    Your have then selected the
    max(cstrackout) ,max(csrework) which would probably pick these variables up.
    Rename your variables to v_CSREWORK and v_CSTRACKOUT or remove altogether as no sign they are being used which should fix that problem. The normal naming standard for oracle is to name variables with a v_ and parameters with a p_ to prevent problems with naming.

  • [SOLVED] bibble5pro aur package not working?

    Hi together,
    i did
    yaourt -S -aur bibble5pro
    and installed this package. Worked without error, but by starting bibble5pro i got this:
    [vinschni@myhost ~]$ bibble5pro
    Install Path: /opt/bibble5pro
    LD_PATH: /opt/bibble5pro/lib:
    XLIB_SKIP_ARGB_VISUALS: 1
    linux-gate.so.1 => (0xb7810000)
    libkodakcms.so => /opt/bibble5pro/lib/libkodakcms.so (0xb7795000)
    libuuid.so.1 => /lib/libuuid.so.1 (0xb7773000)
    libtcmalloc_minimal.so.0 => /opt/bibble5pro/lib/libtcmalloc_minimal.so.0 (0xb7741000)
    libQtSvg.so.4 => /opt/bibble5pro/lib/libQtSvg.so.4 (0xb76f5000)
    libQt3Support.so.4 => /opt/bibble5pro/lib/libQt3Support.so.4 (0xb740f000)
    libQtSql.so.4 => /opt/bibble5pro/lib/libQtSql.so.4 (0xb7376000)
    libQtOpenGL.so.4 => /opt/bibble5pro/lib/libQtOpenGL.so.4 (0xb7301000)
    libGLU.so.1 => /usr/lib/libGLU.so.1 (0xb7293000)
    libGL.so.1 => /usr/lib/libGL.so.1 (0xb71cf000)
    libQtNetwork.so.4 => /opt/bibble5pro/lib/libQtNetwork.so.4 (0xb70d2000)
    libQtDesigner.so.4 => /opt/bibble5pro/lib/libQtDesigner.so.4 (0xb6df6000)
    libQtScript.so.4 => /opt/bibble5pro/lib/libQtScript.so.4 (0xb6cd5000)
    libQtXml.so.4 => /opt/bibble5pro/lib/libQtXml.so.4 (0xb6c90000)
    libQtGui.so.4 => /opt/bibble5pro/lib/libQtGui.so.4 (0xb63a8000)
    libpng12.so.0 => not found
    libSM.so.6 => /usr/lib/libSM.so.6 (0xb639f000)
    libICE.so.6 => /usr/lib/libICE.so.6 (0xb6388000)
    libXi.so.6 => /usr/lib/libXi.so.6 (0xb637b000)
    libXrender.so.1 => /usr/lib/libXrender.so.1 (0xb6372000)
    libXrandr.so.2 => /usr/lib/libXrandr.so.2 (0xb636a000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0xb62e5000)
    libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0xb62b7000)
    libXext.so.6 => /usr/lib/libXext.so.6 (0xb62a9000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0xb618f000)
    libQtCore.so.4 => /opt/bibble5pro/lib/libQtCore.so.4 (0xb5f69000)
    libz.so.1 => /usr/lib/libz.so.1 (0xb5f54000)
    libgthread-2.0.so.0 => /usr/lib/libgthread-2.0.so.0 (0xb5f50000)
    librt.so.1 => /lib/librt.so.1 (0xb5f47000)
    libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0xb5e82000)
    libdl.so.2 => /lib/libdl.so.2 (0xb5e7e000)
    libpthread.so.0 => /lib/libpthread.so.0 (0xb5e64000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0xb5d6d000)
    libm.so.6 => /lib/libm.so.6 (0xb5d47000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0xb5d2a000)
    libc.so.6 => /lib/libc.so.6 (0xb5be3000)
    /lib/ld-linux.so.2 (0xb7811000)
    libpng12.so.0 => not found
    libpng12.so.0 => not found
    libpng12.so.0 => not found
    libGLcore.so.1 => /usr/lib/libGLcore.so.1 (0xb45d2000)
    libnvidia-tls.so.1 => /usr/lib/libnvidia-tls.so.1 (0xb45cf000)
    libpng12.so.0 => not found
    libpng12.so.0 => not found
    libexpat.so.1 => /usr/lib/libexpat.so.1 (0xb45a9000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0xb4590000)
    libpcre.so.0 => /lib/libpcre.so.0 (0xb455d000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0xb455a000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb4555000)
    ./bibblepro: error while loading shared libraries: libpng12.so.0: cannot open shared object file: No such file or directory
    Is there maybe missing a dependency in pkgbuild? Starting with root access dosen't make a difference. Hope somebody has an idea.
    Greetings,
    Vinschni
    Last edited by Vinschni (2010-04-16 12:11:51)

    Got it working.
    In libpng12 PKGBUILD was an error in line 26. After deleting 
    patch -p1 -i "${srcdir}/libpng-1.2.38-apng.patch" || return 1
    build was successful.
    Vinschni

  • Package not working like it should! :(

    Ok I created a package, It compiles fine but returns no results.
    My package contains a function that calculates my instructors bonus depending on how many lessons he has taught in the last 7 days.
    I then have a procedure to check that the bonus is not over 400, 400 is the max bonus that can be earned in any 1 week.
    I belive the source of the problem is the data being fed to the procedure is wrong or mixed up,. The function calculates the correct bonus, so that is working fine.
    I am struggling to pass the results of the function into the procedure for checking!
    I have spent the last couple of hours trying to see where I am going wrong but i think my brain has packed in!
    here is the package.
    CREATE OR REPLACE PACKAGE wage_calc IS
    full_wage NUMBER(8);
    FUNCTION instructor_bonus
    (ins_grade in NUMBER , ins_id in VARCHAR2)
    RETURN NUMBER;
    PROCEDURE bonus_checker
         (ins_grade IN NUMBER,
          ins_bonus IN NUMBER,
          ins_id_in IN VARCHAR2,
          bonus OUT VARCHAR2);
    END;
    CREATE OR REPLACE PACKAGE BODY wage_calc IS
    FUNCTION instructor_bonus
    (ins_grade in NUMBER , ins_id in VARCHAR2)
    RETURN NUMBER
    IS
    less_taught NUMBER(8);
    ins_bonus NUMBER(8);     
    BEGIN
         SELECT count(fk_ins_id)
         INTO less_taught
         FROM class_schedule
         WHERE fk_ins_id = ins_id
         AND date_of BETWEEN SYSDATE-7 AND SYSDATE;
              IF      ins_grade = '1' THEN ins_bonus := less_taught * 15.00;
              ELSIF     ins_grade = '2' THEN ins_bonus := less_taught * 25.00;
              ELSIF     ins_grade = '3' THEN ins_bonus := less_taught * 35.00;
              END IF;
              IF      less_taught >= 5 THEN ins_bonus := ins_bonus * 1.1;
              END IF;
              RETURN ins_bonus;
         END instructor_bonus;
    PROCEDURE bonus_checker
         (ins_grade IN NUMBER,
          ins_bonus IN NUMBER,
          ins_id_in IN VARCHAR2,
          bonus OUT VARCHAR2)
    IS
    ins_bonus_res NUMBER(8);
    BEGIN
         SELECT instructor_bonus(ins_bonus,ins_id)
         INTO ins_bonus_res
         FROM instructor
         WHERE ins_id = ins_id_in;
         IF ins_grade = 1 AND ins_bonus_res > 250
         THEN ins_bonus_res := 250;
                   DBMS_OUTPUT.PUT_LINE(ins_id_in|| 'Has reached full bonus for grade '||ins_grade||'  it will be capped, bonus = '||ins_bonus_res);
         ELSIF ins_grade = 2 AND ins_bonus_res > 350
         THEN ins_bonus_res := 350;
                   DBMS_OUTPUT.PUT_LINE(ins_id_in|| 'Has reached full bonus for grade '||ins_grade||'  it will be capped, bonus = '||ins_bonus_res);
         ELSIF ins_grade = 3 AND ins_bonus_res > 500
         THEN ins_bonus_res := 500;
                   DBMS_OUTPUT.PUT_LINE(ins_id_in|| 'Has reached full bonus for grade '||ins_grade||'  it will be capped, bonus = '||ins_bonus_res);
         ELSE ins_bonus_res := ins_bonus_res;
         DBMS_OUTPUT.PUT_LINE('Instructor bonus = '||ins_bonus_res);
         END IF;
         END bonus_checker;
    END;
    /When i attempt to test it with this data.
    VARIABLE ins_bonus_res NUMBER
    EXECUTE wage_calc.bonus_checker (1, 1, 1, :ins_bonus_res);I get this....
    PL/SQL procedure successfully completed.
    SQL> print :ins_bonus_res
    INS_BONUS_RES
    -------------So I am stuck! If anyone coudl help me it would be appriciated! Thanks.
    Message was edited by:
    stevenmac
    Message was edited by:
    stevenmac

    Ok that works now thanks!
    Is there any way to improve this paackage? At the moment i have to input the ins_id and the ins_bonus.
    VARIABLE ins_bonus_res NUMBER
    EXECUTE wage_calc.bonus_checker (1,1, :ins_bonus_res);Is there any way to change it so that I just need to input the ins_id??
    Here is my code so far.
    SET SERVEROUTPUT ON
    CREATE OR REPLACE PACKAGE wage_calc IS
    full_wage NUMBER(8);
    FUNCTION instructor_bonus
    (ins_grade in NUMBER , ins_id in VARCHAR2)
    RETURN NUMBER;
    PROCEDURE bonus_checker
         (ins_id_in IN VARCHAR2,
          ins_bonus IN NUMBER,
          bonus OUT VARCHAR2);
    END;
    CREATE OR REPLACE PACKAGE BODY wage_calc IS
    FUNCTION instructor_bonus
    (ins_grade in NUMBER , ins_id in VARCHAR2)
    RETURN NUMBER
    IS
    less_taught NUMBER(8);
    ins_bonus NUMBER(8);     
    BEGIN
         SELECT count(fk_ins_id)
         INTO less_taught
         FROM class_schedule
         WHERE fk_ins_id = ins_id
         AND date_of BETWEEN SYSDATE-7 AND SYSDATE;
              IF      ins_grade = '1' THEN ins_bonus := less_taught * 15.00;
              ELSIF     ins_grade = '2' THEN ins_bonus := less_taught * 25.00;
              ELSIF     ins_grade = '3' THEN ins_bonus := less_taught * 35.00;
              END IF;
              IF      less_taught >= 5 THEN ins_bonus := ins_bonus * 1.1;
              END IF;
              RETURN ins_bonus;
         END instructor_bonus;
    PROCEDURE bonus_checker
         (ins_id_in IN VARCHAR2,
          ins_bonus IN NUMBER,
          bonus OUT VARCHAR2)
    IS
         ins_bonus_res NUMBER(8);
         ins_grade_t NUMBER(8);
         ins_name_t VARCHAR2(12);
    BEGIN
         SELECT instructor_bonus(ins_bonus, ins_id), ins_grade, ins_name
         INTO ins_bonus_res, ins_grade_t, ins_name_t
         FROM instructor
         WHERE ins_id = ins_id_in;
         IF ins_grade_t = 1 AND ins_bonus_res > 250
         THEN ins_bonus_res := 250;
                   DBMS_OUTPUT.PUT_LINE(ins_name_t|| 'Has reached full bonus for grade '||ins_grade_t||'  it will be capped, bonus = '||ins_bonus_res);
         ELSIF ins_grade_t = 2 AND ins_bonus_res > 350
         THEN ins_bonus_res := 350;
                   DBMS_OUTPUT.PUT_LINE(ins_name_t|| 'Has reached full bonus for grade '||ins_grade_t||'  it will be capped, bonus = '||ins_bonus_res);
         ELSIF ins_grade_t = 3 AND ins_bonus_res > 500
         THEN ins_bonus_res := 500;
                   DBMS_OUTPUT.PUT_LINE(ins_name_t|| 'Has reached full bonus for grade '||ins_grade_t||'  it will be capped, bonus = '||ins_bonus_res);
         ELSE ins_bonus_res := ins_bonus_res;
         DBMS_OUTPUT.PUT_LINE('Bonus for '||ins_name_t||' = '||ins_bonus_res);
         END IF;
         bonus := ins_bonus_res;
         END bonus_checker;
    END;
    /Thanks in advance

  • Sun's JavaMail package not working

    I'm trying to implement interface to SendMail java package. On 8.1.7 database.
    I'm following instructions on
    http://www.akadia.com/services/java_mail_plsql.html
    to the dot.
    I got everything loaded and installed without errors.
    But when I'm trying to test package, i'm not getting any errors and I'm not getting message either. Email just dissapears somewhere...
    declare
    errorstatus number;
    errormessage varchar2(2000);
    BEGIN
    ErrorStatus := SendMailJPkg.SendMail(
    SMTPServerName => 'qube.odl.com',
    Sender => '[email protected]',
    Recipient => '[email protected]',
    CcRecipient => '',
    BccRecipient => '',
    Subject => 'This is the subject line: Test JavaMail',
    Body => 'This is the body: Hello, this is a test' ||
    SendMailJPkg.EOL || 'that spans 2 lines',
    ErrorMessage => ErrorMessage,
    Attachments => SendMailJPkg.ATTACHMENTS_LIST( '/usr/apps11/email/new_odl_logo.gif','/usr/apps11/email/odl_logo_small.gif' )
    pl(errorstatus);
    pl(errormessage);
    END;
    Is there any setup step for java or something else I'm missing?
    Thanks

    Vladimir,
    No offence, but in the article you refer to, they did say that they only tested against an Oracle 9i database (and not an Oracle 8i database). I also didn't see anything in the article that says that the procedure they describe should work in Oracle 8i as well.
    Apart from that, and excuse me if it is an obvious question, but can you send eMail from the machine where Oracle is running? For example, if the machine is a UNIX machine, can you use the "mail" (or "mailx") command to send eMail.
    I recall working on a UNIX system that demonstrated the behaviour you are describing. When I tried to send eMail to an account that was outside of the UNIX box, I would get no error messages, but the eMail simply seemed to disappear. Perhaps you are experiencing the same problem?
    [Unfortunately, I never resolved this issue, so even if it is your problem, I'm afraid I can't help you resolve it, anyway. Sorry :-( ]
    Good Luck,
    Avi.

  • COpy Package not working as it should in BPC V 5.0

    Problem:-
    When I choose Replace and Clear Data Values, it merges them .. I have run it few times and each time the data was duobled.
    When I chose, Merge Data Values, it cleared and the numbers !!. 
    Possiable Cause:-
    The function seems to be working in reverse order, Could this be bug in the SAP BPC v5.0?
    If any of you have any idea how to fix this, I would appreciate it.  Thanks.
    Sam

    Hi Sam,
    Check the modify script for the copy package by going to modify package, view script and advanced tab.
    In script, in the prompt comand, '0' should be assigned to Merge data values and 1 to clear data. If it is in reverse order, change it and save it back.
    Note that if you are using sql 2005, you can directly modify the script, if it is 2000, you need to modify the EVmodifyscript task in the DTS assigned to Copy package.
    Hope this helps,
    Kranthi

  • SSIS Package Not working

    Hi
    We have SSIS Package in which all the tasks in control flow are connected with "Completion Precedence".
    Ideally it should execute all the tasks irrespective of failed or successful execution of any of the task. And this works as expected from BIDS.
    But when package is scheduled from SQL Server Agent job (Single step), it doesn't execute next task (Execute SQL Task) if there is failure with any of the task before that (Execute
    SQL task) even though they are connected with Completion precedence.
    We have several Execute Package tasks which call child packages to load the data and all are executed in parallel.  There is one Execute Sql task at the end of one of the Execute Package
    task (Connected using completion precedence) which calls stored procedure to do some cleansing activities.

    I have now enabled the log and it seems that Execute SQL Task was executed but it didn't take any time to execute. Job started at  5:44:42 AM and ended at  5:44:42 AM. It logged the event Preexecute and PostExecute both at the same
    time 5:44:42 AM but data was not updated through the SP but no Error event logged. Again when I ran SP anually it worked fine and updated data. SP Takes somewhere around 2 mins to execute.

  • Select Into code not working in Trigger

    Hello there,
    I was hoping somebody could give me the solution to this problem ,
    I have a scenarior in which I was trying to insert into table B if an insert occurs on Table A by the use of a trigger on table A .
    Here is the code:
    BEGIN
    IF INSERTING THEN
    select MAX(Val1),MAX(Val2)
    INTO localVar_1 ,localVar_2
    from tableC,tableD
    where <<some join condition>>
    INSERT INTO TABLEB(col1 ,
    col2,
    col3,
    col4,
    col5,
    col6,
    col7,
    col8,
    col9)
    VALUES(:new.someValue1,
    :new.someValue2,
    :new.someValue3,
    localVar_1,
    localVar_2,
    :new.someValue4,
    :new.someValue5,
    :new.someValue6,
    :new.someValue7);
    END IF;
    The Error I get is ORA-01400 "Cannot Insert Null Into" "Schema"."Table"."Column" . I suspect my localVar_1 to be nulled out ,which brings into question the SELECT INTO prior to this which is supposed to assign a value to these variables , If I do just a SELECT that seems to work but SELECT INTO seems to be having problems . Any suggestions?

    Check the NOT NULL constraint in TABLEB, and if you find any columns having it, try to insert a fixed value and see it it works.
    thanks

  • WE20 - Pack size not working/IDOC packaging not working - PI 7.1

    Hi all,
    My requirement is to collect idocs and send to PI at one point of time in a day.
    I kept Pack.Size = 100 in partner profile (WE20), in PI 7.1 - Sender Communication channel I assigned the same value 100 to pack size.
    Now the problem is when I create more than 10 idocs and trigger manually by rseout00. for example
    15 idocs are pushed to PI by executing RSEOUT00. In PI when I check IDX5 or SXMB_MONI, 2 message ID's are generated one with 10 idocs and the other with 5 idocs.
    It works fine meaning creates only one message id if the total count of IDOC's are 10 or <10.
    Any ideas/suggestions appreciated.
    Thanks,
    Krishna

    Yes Prateek,
    In Sender Communication channel - IDOC package size is assigned as '100' and only 10 idocs are collecting for one message id.
    I checked the assignment and it was correct. I changed the description, saved and activated Sender agreement & Sender Communication Channel.
    No luck.
    Regards,
    Krishna

Maybe you are looking for

  • ITunes no longer sees iPhone

    Suddenly, after I upgraded to Leopard, iTunes ceased launching when I plugged in the phone. The phone charges, but iTunes does not see it. iPhoto does, but iTunes does not. I reset the phone, reinstalled iTunes, and restarted the computer, to no avai

  • [iPhone4 4.2.1] Video audio no longer plays when put to sleep

    I have a video of a concert on my iPhone 4. Before the update, I was able to play it, put the phone in sleep mode and listen to the audio only. Now, whenever I try to do it, the audio just stops. Is there any way to fix this? I liked being able to po

  • IDOC TO FILE ( PRODUCTION ORDER CREATED IN R/3 (LOIPRO01 Idoc) IS SENT 2 XI

    PLS...I NEED SOLUTION AS SOON AS POSSIBLE When a production order is created and is  released in R/3,the idoc (LOIPRO01 Idoc) should be passed (sent) to xi system and mapped into a file using FILEADAPTER.      Source :   SAP ERP ( LOIPRO01 Idoc)     

  • Ipad 1 won't restore error (1)

    I've tried at least 15 times.  I've unplugged all other USB cables, etc.  I've already been able to update 2 iphones with IOS 5 but now I'm stuck with the iPad on recovery.  I'm on an iMac and everything is updated.  Any ideas???

  • A new post --

    -- As once your new thread looks like it has been resolved (even though it has not) no one seems to answer any more. Well the last thread was not answered, So I emailed a mod and looked like it might be OK BUT NO the profile is right but 1meg lower t